prestodb/presto · error · PrestoException
GENERIC_SPILL_FAILURE
GENERIC_SPILL_FAILURE
Error message
Failed to create spill file: %s
What it means
Runtime error from FileSingleStreamSpiller: creating the temporary spill file on the configured spill filesystem failed (IOException wrapped). This is an environment/infrastructure failure of the spill path, not a query-logic problem; the %s names the file that could not be created.
Source
Thrown at presto-main-base/src/main/java/com/facebook/presto/spiller/FileSingleStreamSpiller.java:111
this.spillCipher = requireNonNull(spillCipher, "spillCipher is null");
checkState(!spillCipher.isPresent() || !spillCipher.get().isDestroyed(), "spillCipher is already destroyed");
this.spillCipher.ifPresent(cipher -> closer.register(cipher::destroy));
// HACK!
// The writePages() method is called in a separate thread pool and it's possible that
// these spiller thread can run concurrently with the close() method.
// Due to this race when the spiller thread is running, the driver thread:
// 1. Can zero out the memory reservation even though the spiller thread physically holds onto that memory.
// 2. Can close/delete the temp file(s) used for spilling, which doesn't have any visible side effects, but still not desirable.
// To hack around the first issue we reserve the memory in the constructor and we release it in the close() method.
// This means we start accounting for the memory before the spiller thread allocates it, and we release the memory reservation
// before/after the spiller thread allocates that memory -- -- whether before or after depends on whether writePages() is in the
// middle of execution when close() is called (note that this applies to both readPages() and writePages() methods).
this.memoryContext.setBytes(BUFFER_SIZE);
try {
this.targetFile = closer.register(new FileHolder(Files.createTempFile(spillPath, SPILL_FILE_PREFIX, SPILL_FILE_SUFFIX)));
}
catch (IOException e) {
throw new PrestoException(GENERIC_SPILL_FAILURE, format("Failed to create spill file: %s", e.getMessage()), e);
}
}
@Override
public ListenableFuture<?> spill(Iterator<Page> pageIterator)
{
requireNonNull(pageIterator, "pageIterator is null");
checkNoSpillInProgress();
spillInProgress = executor.submit(() -> writePages(pageIterator));
return spillInProgress;
}
@Override
public long getSpilledPagesInMemorySize()
{
return spilledPagesInMemorySize;
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Check that the spill filesystem has free space and correct permissions for the Presto process user
- Verify experimental.spiller-spill-path points to a valid, writable local directory
- Ensure the spill disk is not full or read-only; clean up stale spill files
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at presto-main-base/src/main/java/com/facebook/presto/spiller/FileSingleStreamSpiller.java:111 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/6ebe3e07a56c8084.
Report an issue: GitHub.