{"record":{"id":"9c815fb3ecca49d6","repo":"apache/cassandra","slug":"throwing-new-runtime-to-bypass-exception-handler-w","errorCode":null,"errorMessage":"Throwing new Runtime to bypass exception handler when disk is full","messagePattern":"Throwing new Runtime to bypass exception handler when disk is full","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/db/compaction/AbstractCompactionTask.java","lineNumber":116,"sourceCode":"                }\n            }\n        }\n    }\n\n    /**\n     * executes the task and unmarks sstables compacting\n     */\n    public void execute(ActiveCompactionsTracker activeCompactions)\n    {\n        try\n        {\n            executeInternal(activeCompactions);\n        }\n        catch(FSDiskFullWriteError e)\n        {\n            RuntimeException cause = new RuntimeException(\"Converted from FSDiskFullWriteError: \" + e.getMessage());\n            cause.setStackTrace(e.getStackTrace());\n            throw new RuntimeException(\"Throwing new Runtime to bypass exception handler when disk is full\", cause);\n        }\n        finally\n        {\n            cleanup();\n        }\n    }\n\n    protected void cleanup()\n    {\n        transaction.close();\n    }\n\n    public void rejected()\n    {\n        cleanup();\n    }\n\n    protected abstract void executeInternal(ActiveCompactionsTracker activeCompactions);","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compaction/AbstractCompactionTask.java#L98-L134","documentation":"When a compaction task execution hits an FSDiskFullWriteError, the task rethrows it as a plain RuntimeException so the generic exception handler around executeInternal does not swallow or misroute a disk-full condition. The original error is attached as the cause.","triggerScenarios":"Running compaction (manually via nodetool compact, or background compaction) while the data directory volume fills up mid-write.","commonSituations":"Under-provisioned disks on nodes with large compaction write amplification, running repairs/compactions in parallel on nearly-full nodes, mis-sized ephemeral storage.","solutions":["Free disk space or add storage on the affected node, then re-run compaction.","Lower compaction throughput (compaction_throughput) to reduce transient space needs.","Check the cause (Converted from FSDiskFullWriteError) to identify which data directory is full.","Reduce concurrent compactions (concurrent_compactors) or compact fewer SSTables at once."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before compacting: verify free space exceeds largest uncompacted SSTable size\nlong free = Files.getFileStore(Paths.get(dataDir)).getUsableSpace();\nif (free < requiredBytes) throw new IllegalStateException(\"insufficient disk for compaction\");","typeGuard":null,"tryCatchPattern":"try { compactionTask.execute(null); } catch (RuntimeException e) { if (e.getMessage().contains(\"bypass exception handler when disk is full\")) { alertDiskFull(e.getCause()); } else { throw e; } }","preventionTips":["Monitor disk usage and alert before volumes reach capacity","Throttle compaction_throughput on small disks","Schedule compactions after verifying free-space headroom"],"tags":["disk-full","compaction","io"],"backgroundTag":"file-write-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}