apache/cassandra · critical · RuntimeException
Throwing new Runtime to bypass exception handler when disk i
Error message
Throwing new Runtime to bypass exception handler when disk is full
What it means
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.
Source
Thrown at src/java/org/apache/cassandra/db/compaction/AbstractCompactionTask.java:116
}
}
}
}
/**
* executes the task and unmarks sstables compacting
*/
public void execute(ActiveCompactionsTracker activeCompactions)
{
try
{
executeInternal(activeCompactions);
}
catch(FSDiskFullWriteError e)
{
RuntimeException cause = new RuntimeException("Converted from FSDiskFullWriteError: " + e.getMessage());
cause.setStackTrace(e.getStackTrace());
throw new RuntimeException("Throwing new Runtime to bypass exception handler when disk is full", cause);
}
finally
{
cleanup();
}
}
protected void cleanup()
{
transaction.close();
}
public void rejected()
{
cleanup();
}
protected abstract void executeInternal(ActiveCompactionsTracker activeCompactions);View on GitHub (pinned to 88fd0f6a0e)
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.
Defensive patterns
Strategy: try-catch
Validate before calling
// before compacting: verify free space exceeds largest uncompacted SSTable size
long free = Files.getFileStore(Paths.get(dataDir)).getUsableSpace();
if (free < requiredBytes) throw new IllegalStateException("insufficient disk for compaction"); Try / catch
try { compactionTask.execute(null); } catch (RuntimeException e) { if (e.getMessage().contains("bypass exception handler when disk is full")) { alertDiskFull(e.getCause()); } else { throw e; } } Prevention
- Monitor disk usage and alert before volumes reach capacity
- Throttle compaction_throughput on small disks
- Schedule compactions after verifying free-space headroom
When it happens
Trigger: Running compaction (manually via nodetool compact, or background compaction) while the data directory volume fills up mid-write.
Common situations: Under-provisioned disks on nodes with large compaction write amplification, running repairs/compactions in parallel on nearly-full nodes, mis-sized ephemeral storage.
Understand the failure class
Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.
Related errors
- Unable to resolve canonical path for
- FSWriteError
- Failed to create a key iterator for sstable ${filename}
- Unsupported disk access mode for compaction_read_disk_access
- concurrent_compactors should be strictly greater than 0, but
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/9c815fb3ecca49d6.
Report an issue: GitHub.