prestodb/presto · error · RuntimeException

could not close some single stream spillers

Error message

could not close some single stream spillers

What it means

GenericSpiller.close() delegates to the Guava closer that owns all per-channel SingleStreamSpiller instances. If closing any of them throws IOException, it wraps the failure in RuntimeException 'could not close some single stream spillers'. This typically indicates leaked spill files or an underlying filesystem I/O failure during cleanup.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/spiller/GenericSpiller.java:92

                .map(SingleStreamSpiller::getSpilledPages)
                .collect(toList());
    }

    @Override
    public void commit()
    {
        checkNoSpillInProgress();
        singleStreamSpillers.stream().forEach(SingleStreamSpiller::commit);
    }

    @Override
    public void close()
    {
        try {
            closer.close();
        }
        catch (IOException e) {
            throw new RuntimeException("could not close some single stream spillers", e);
        }
    }

    private void checkNoSpillInProgress()
    {
        checkState(previousSpill.isDone(), "previous spill still in progress");
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Inspect the cause chain of the RuntimeException for the underlying IOException and fix the storage issue (restore/unmount cleanly the spill volume).
  2. Manually clean leftover spill files in the configured spill paths after the failure.
  3. Check disk health (dmesg, smartctl) if repeated — hardware issues surface as close-time IOExceptions.
  4. Upgrade Presto if hitting a known bug in closer/suppression handling for multi-channel spillers.

Example fix

// no code fix; operational remedy
// 1) find cause: grep the cause chain for the original IOException
// 2) clean leftovers:
// find /var/spill -name '*presto*' -mtime +1 -delete
Defensive patterns

Strategy: try-catch

Try / catch

try {
    spiller.close();
} catch (RuntimeException e) {
    log.warn("spiller close failed; possible leaked spill files", e);
    // continue teardown; clean spill dir of orphan files
}

Prevention

When it happens

Trigger: Calling GenericSpiller.close() (driver/operator teardown, query cancellation or completion) when closer.close() throws IOException from one or more wrapped SingleStreamSpiller resources — e.g. failure deleting/writing spill files.

Common situations: Disk removed/unmounted while spill files are open; NFS I/O error during cleanup; OS-level resource limits causing file-close failures; cascading failure after an earlier spill error left resources in a bad state.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/201b9c98a181f56e. Report an issue: GitHub.