apache/cassandra · error · RuntimeException
Failed to execute stress action
Error message
Failed to execute stress action
What it means
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.
Source
Thrown at tools/stress/src/org/apache/cassandra/stress/StressAction.java:103
if (settings.rate.opsPerSecond > 0)
rateLimiter = new UniformRateLimiter(settings.rate.opsPerSecond);
boolean success;
if (settings.rate.minThreads > 0)
success = runMulti(settings.rate.auto, rateLimiter);
else
success = null != run(settings.command.getFactory(settings), settings.rate.threadCount, settings.command.count,
settings.command.duration, rateLimiter, settings.command.durationUnits, output, false);
if (success)
output.println("END");
else
output.println("FAILURE");
settings.disconnect();
if (!success)
throw new RuntimeException("Failed to execute stress action");
}
// type provided separately to support recursive call for mixed command with each command type it is performing
private void warmup(OpDistributionFactory operations)
{
// do 25% of iterations as warmup but no more than 50k (by default hotspot compiles methods after 10k invocations)
int iterations = (settings.command.count >= 0
? Math.min(50000, (int)(settings.command.count * 0.25))
: 50000) * settings.node.nodes.size();
if (iterations <= 0) return;
int threads = 100;
if (settings.rate.maxThreads > 0)
threads = Math.min(threads, settings.rate.maxThreads);
if (settings.rate.threadCount > 0)
threads = Math.min(threads, settings.rate.threadCount);
View on GitHub (pinned to 88fd0f6a0e)
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.
Example fix
// before
// run aborts silently with 'Failed to execute stress action' only
// after
try { stressAction.run(); } catch (RuntimeException e) { e.printStackTrace(); checkThreadErrors(); } Defensive patterns
Strategy: try-catch
Validate before calling
// pre-flight the cluster before the full run: // 1) all nodes UP 2) schema created 3) credentials valid // e.g. cqlsh -u user -p pass -e "SELECT now() FROM system.local"
Try / catch
try {
stressAction.run();
} catch (RuntimeException e) {
if ("Failed to execute stress action".equals(e.getMessage())) {
reportThreadErrors(); // parse earlier per-thread output for root cause
} else throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
- Failed to execute warmup
- CIDR group '%s' doesn't exists
- <RuntimeException message> for ks: <keyspace>, table: <table
- Error starting native transport:
- Table {tableName} does not exist in keyspace {keyspace}
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/2ad0f8d9bea60368.
Report an issue: GitHub.