{"record":{"id":"720eafc20badf64f","repo":"apache/cassandra","slug":"failed-to-execute-warmup","errorCode":null,"errorMessage":"Failed to execute warmup","messagePattern":"Failed to execute warmup","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/StressAction.java","lineNumber":129,"sourceCode":"                          ? 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\n        for (OpDistributionFactory single : operations.each())\n        {\n            // we need to warm up all the nodes in the cluster ideally, but we may not be the only stress instance;\n            // so warm up all the nodes we're speaking to only.\n            output.println(String.format(\"Warming up %s with %d iterations...\", single.desc(), iterations));\n            boolean success = null != run(single, threads, iterations, 0, null, null, ResultLogger.NOOP, true);\n            if (!success)\n                throw new RuntimeException(\"Failed to execute warmup\");\n        }\n\n    }\n\n    // TODO : permit varying more than just thread count\n    // TODO : vary thread count based on percentage improvement of previous increment, not by fixed amounts\n    private boolean runMulti(boolean auto, UniformRateLimiter rateLimiter)\n    {\n        if (settings.command.targetUncertainty >= 0)\n            output.println(\"WARNING: uncertainty mode (err<) results in uneven workload between thread runs, so should be used for high level analysis only\");\n        int prevThreadCount = -1;\n        int threadCount = settings.rate.minThreads;\n        List<StressMetrics> results = new ArrayList<>();\n        List<String> runIds = new ArrayList<>();\n        do\n        {\n            output.println(\"\");\n            output.println(String.format(\"Running with %d threadCount\", threadCount));","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/StressAction.java#L111-L147","documentation":"StressAction.warmup runs a short measurement pass (up to ~50k iterations, no timing recorded) to JIT-warm all cluster nodes before the real run. It requires the warmup pass to succeed (success flag from run(...)); if it does not, it throws RuntimeException('Failed to execute warmup'). Since warmup exercises the same operations as the real run, failure almost always predicts the main run would fail too, so the tool fails fast.","triggerScenarios":"Running stress with warmup enabled (default for most profiles) while any operation in the warmup pass fails — bad schema, unreachable nodes, wrong credentials — so run(single, threads, iterations, 0, null, null, NOOP, true) returns null and the RuntimeException is thrown.","commonSituations":"Fresh cluster without the schema created yet; wrong host/port in -node settings; authentication enabled but no credentials supplied; warmup against a keyspace that does not exist.","solutions":["Fix the root cause shown in the warmup thread output (create schema, correct nodes, credentials).","Disable or shorten warmup (e.g. -n with no warmup flag depending on profile) to proceed directly to measurement.","Verify connectivity with cqlsh to the same nodes before re-running stress.","Catch RuntimeException and fall back to running without warmup when the cluster is known-good."],"exampleFix":"// before\nstress write -n 1000000 ...            // warmup fails on missing schema\n// after\ncqlsh -e \"CREATE TABLE IF NOT EXISTS ...\" && stress write -n 1000000 ...","handlingStrategy":"try-catch","validationCode":"// pre-flight before warmup:\n// verify connectivity: cqlsh -e \"DESCRIBE KEYSPACE ks\" and check all -node hosts reachable on 9042","typeGuard":null,"tryCatchPattern":"try {\n    stressAction.run();\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"warmup\")) {\n        log.warn(\"Warmup failed; retrying without warmup\", e);\n        runWithoutWarmup();\n    } else throw e;\n}","preventionTips":["Create the schema before running stress so warmup statements succeed.","Verify node reachability and auth credentials before launching stress.","Reduce warmup iterations on small clusters to limit exposure to transient errors."],"tags":["stress-tool","warmup","run-failure"],"backgroundTag":"database-query-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"}