{"record":{"id":"2ad0f8d9bea60368","repo":"apache/cassandra","slug":"failed-to-execute-stress-action","errorCode":null,"errorMessage":"Failed to execute stress action","messagePattern":"Failed to execute stress action","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/StressAction.java","lineNumber":103,"sourceCode":"        if (settings.rate.opsPerSecond > 0)\n            rateLimiter = new UniformRateLimiter(settings.rate.opsPerSecond);\n\n        boolean success;\n        if (settings.rate.minThreads > 0)\n            success = runMulti(settings.rate.auto, rateLimiter);\n        else\n            success = null != run(settings.command.getFactory(settings), settings.rate.threadCount, settings.command.count,\n                                  settings.command.duration, rateLimiter, settings.command.durationUnits, output, false);\n\n        if (success)\n            output.println(\"END\");\n        else\n            output.println(\"FAILURE\");\n\n        settings.disconnect();\n\n        if (!success)\n            throw new RuntimeException(\"Failed to execute stress action\");\n    }\n\n    // type provided separately to support recursive call for mixed command with each command type it is performing\n    private void warmup(OpDistributionFactory operations)\n    {\n        // do 25% of iterations as warmup but no more than 50k (by default hotspot compiles methods after 10k invocations)\n        int iterations = (settings.command.count >= 0\n                          ? Math.min(50000, (int)(settings.command.count * 0.25))\n                          : 50000) * settings.node.nodes.size();\n        if (iterations <= 0) return;\n\n        int threads = 100;\n\n        if (settings.rate.maxThreads > 0)\n            threads = Math.min(threads, settings.rate.maxThreads);\n        if (settings.rate.threadCount > 0)\n            threads = Math.min(threads, settings.rate.threadCount);\n","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/StressAction.java#L85-L121","documentation":"StressAction.run orchestrates a whole stress run (threads, op distribution, timing). At the end it prints SUCCESS or FAILURE and, if the measured run was not successful (operations failed, thread errors, or the run loop reported failure), throws RuntimeException('Failed to execute stress action'). It is the top-level signal that the stress run did not complete cleanly; the real cause is usually printed earlier by per-thread exception reporting.","triggerScenarios":"run(single, ...) returns success=false for the main measurement phase — e.g. any worker thread hit an operation error (IOException from Operation.error), an uncaught exception in a stress thread, or the run was interrupted/failing — so StressAction throws RuntimeException at line 103.","commonSituations":"Cluster overloaded or down during the run; stress profile statements failing against the schema; key too small/large causing coordinator errors; running multiple stress instances causing timeouts.","solutions":["Read the earlier per-thread stack traces/exception messages in the stress output to find the root failure.","Re-run with relaxed error settings (--errors ignore) or fewer threads/rate to rule out overload.","Verify the schema matches the stress profile (run the profile's schema DDL) and that all nodes are UP.","Catch RuntimeException in the harness invoking StressAction and treat it as a non-zero exit with diagnostics."],"exampleFix":"// before\n// run aborts silently with 'Failed to execute stress action' only\n// after\ntry { stressAction.run(); } catch (RuntimeException e) { e.printStackTrace(); checkThreadErrors(); }","handlingStrategy":"try-catch","validationCode":"// pre-flight the cluster before the full run:\n// 1) all nodes UP  2) schema created  3) credentials valid\n// e.g. cqlsh -u user -p pass -e \"SELECT now() FROM system.local\"","typeGuard":null,"tryCatchPattern":"try {\n    stressAction.run();\n} catch (RuntimeException e) {\n    if (\"Failed to execute stress action\".equals(e.getMessage())) {\n        reportThreadErrors(); // parse earlier per-thread output for root cause\n    } else throw e;\n}","preventionTips":["Always read the per-thread error output preceding the summary FAILURE line.","Start with a small -n to smoke-test the profile before full runs.","Keep error settings strict in CI so failures surface as non-zero exits here."],"tags":["stress-tool","run-failure","runtime-exception"],"backgroundTag":"http-request-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}