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

  1. Free disk space or add storage on the affected node, then re-run compaction.
  2. Lower compaction throughput (compaction_throughput) to reduce transient space needs.
  3. Check the cause (Converted from FSDiskFullWriteError) to identify which data directory is full.
  4. 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

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


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/9c815fb3ecca49d6. Report an issue: GitHub.