{"record":{"id":"588b2d6e47d6893e","repo":"apache/cassandra","slug":"unrecognised-attempt-modifier-modkind","errorCode":null,"errorMessage":"Unrecognised attempt modifier: {modkind}","messagePattern":"Unrecognised attempt modifier: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/TimeoutStrategy.java","lineNumber":331,"sourceCode":"    private static @Nullable LatencyModifier parseLatencyModifier(String spec, Matcher m, LatencyModifierFactory modifiers)\n    {\n        String mod = m.group(\"mod\");\n        String modkind = m.group(\"modkind\");\n        double modifier = 1.0;\n        if (mod != null) modifier = Double.parseDouble(mod);\n        else if (modkind == null) return null;\n        else if (!modkind.startsWith(\"*\"))\n            throw new IllegalArgumentException(\"Invalid latency modifier specification: \" + spec + \". Expect constant factor as base for exponent.\");\n\n        if (modkind == null)\n            return modifiers.multiply(modifier);\n\n        if (modkind.startsWith(\"*\"))\n            return modifiers.multiplyByAttempts(modifier);\n        else if (modkind.startsWith(\"^\"))\n            return modifiers.multiplyByAttemptsExp(modifier);\n        else\n            throw new IllegalArgumentException(\"Unrecognised attempt modifier: \" + modkind);\n    }\n\n    static long saturatedCast(double v)\n    {\n        if (v > Long.MAX_VALUE)\n            return Long.MAX_VALUE;\n        return (long) v;\n    }\n\n    public static TimeoutStrategy parse(String input, LatencySourceFactory latencies)\n    {\n        Matcher m = PARSE.matcher(input);\n        if (!m.matches())\n            throw new IllegalArgumentException(\"Invalid specification: '\" + input + \"'; does not match \" + PARSE);\n        long min = parseInMicros(m.group(\"min\"), 0);\n        long max = parseInMicros(m.group(\"max\"), Long.MAX_VALUE);\n        Wait wait = TimeoutStrategy.parseWait(m.group(\"wait\"), latencies);\n        return new TimeoutStrategy(wait, min, max);","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/TimeoutStrategy.java#L313-L349","documentation":"IllegalArgumentException from TimeoutStrategy.parseLatencyModifier when parsing a latency modifier spec: the modifier kind (modkind) is not a recognized attempt-based modifier. This is a guard over user-supplied configuration strings for simulated/adjusted timeouts; only known modifier syntaxes (e.g. a leading '*' constant factor) are accepted.","triggerScenarios":"A timeout spec whose modifier starts with a character other than '*' or '^' after the latency expression, e.g. '+2' or '%2'.","commonSituations":"Typo like '*x2' or 'x2' in a configured timeout strategy string; copy-paste from docs of other systems.","solutions":["Use '*' for multiplicative attempt modifiers (e.g. '*1.5').","Use '^' for exponential attempt modifiers (e.g. '^2').","Remove any other prefix characters from the modifier segment."],"exampleFix":"// before\nString spec = \"exponential(100ms)+2\"; // invalid modifier\n// after\nString spec = \"exponential(100ms)*2\";","handlingStrategy":"validation","validationCode":"if (modkind != null && !modkind.startsWith(\"*\") && !modkind.startsWith(\"^\")) throw new IllegalArgumentException(\"modifier must start with * or ^: \" + modkind);","typeGuard":null,"tryCatchPattern":"try { TimeoutStrategy.parse(spec, latencies); }\ncatch (IllegalArgumentException e) { if (e.getMessage().contains(\"Unrecognised attempt modifier\")) { /* fix to *N or ^N */ } throw e; }","preventionTips":["Only '*' and '^' are valid attempt-modifier prefixes","Copy spec examples verbatim from documentation","Lint timeout config strings against the WAIT/PARSE grammar"],"tags":["cassandra","configuration","timeout","parse-error"],"backgroundTag":"invalid-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}