{"record":{"id":"1f6c2c508b64cf5a","repo":"prestodb/presto","slug":"generic-spill-failure","errorCode":"GENERIC_SPILL_FAILURE","errorMessage":"Spilling failed: %s","messagePattern":"Spilling failed: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/operator/SpillingUtils.java","lineNumber":43,"sourceCode":"{\n    private SpillingUtils() {}\n\n    /**\n     * We use this instead of checkSuccess in airlift so we can propagate the error message\n     * and so that we throw a PrestoException rather than an IllegalArgumentException.\n     *\n     * @param spillInProgress\n     */\n    public static void checkSpillSucceeded(Future spillInProgress)\n    {\n        try {\n            getFutureValue(spillInProgress);\n        }\n        catch (PrestoException prestoException) {\n            throw new PrestoException(prestoException::getErrorCode, prestoException.getMessage(), prestoException);\n        }\n        catch (RuntimeException runtimeException) {\n            throw new PrestoException(GENERIC_SPILL_FAILURE, format(\"Spilling failed: %s\", runtimeException.getMessage()), runtimeException);\n        }\n    }\n}\n","sourceCodeStart":25,"sourceCodeEnd":47,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/operator/SpillingUtils.java#L25-L47","documentation":"GENERIC_SPILL_FAILURE is the wrapper Presto throws in SpillingUtils.checkSpillSucceeded when a spilling operation's future completes with a RuntimeException that is not already a PrestoException. Spill operations (aggregations, joins, orderings) run asynchronously; any unexpected exception while writing/reading spill files is rethrown with this error code and the original message preserved.","triggerScenarios":"A spill future passed to checkSpillSucceeded completes exceptionally with a non-PrestoException RuntimeException — e.g. IOException from the spill filesystem, disk full, filesystem unavailable, or a coding error in a custom spiller.","commonSituations":"Spill path (spiller spill-out directory) misconfigured, pointing to a nonexistent or unwritable location; disk full on workers; HDFS/local-FS issues; query memory limits forcing spill on clusters with broken spill storage.","solutions":["Check the wrapped cause (prestoException.getCause()) and worker logs for the underlying IOException/root error.","Verify the spill-path configuration (spiller spill-out-dir / spill filesystem properties) exists and is writable on all workers.","Free disk space or enlarge spill volumes; monitor disk usage on workers.","Run a smaller query to confirm spill infrastructure works; use retry or reduce memory limits if needed.","If the cause is a bug in a custom spiller/filesystem client, fix it or report upstream."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-flight: ensure spill path is writable on workers before heavy queries\n// (run via admin):\n//   hadoop fs -test -e <spill-path>  /  test -w <local spill dir>\n// and confirm free space exceeds expected spill size","typeGuard":null,"tryCatchPattern":"try {\n    executeSpillingQuery();\n} catch (PrestoException e) {\n    if (\"GENERIC_SPILL_FAILURE\".equals(e.getErrorCode().getName())) {\n        Throwable cause = e.getCause();\n        log.warning(\"spill failed: \" + (cause == null ? e : cause.getMessage()));\n        // inspect disk space / spill-path config, then retry\n        throw e;\n    }\n    throw e;\n}","preventionTips":["Verify spill-path is valid and writable on every worker before running memory-heavy queries","Monitor worker disk usage and alert before volumes fill","Inspect getCause() to distinguish disk-full vs config vs code errors","Tune memory limits so spill volume stays within provisioned disk"],"tags":["spill","disk","io","memory"],"backgroundTag":"spill-failure","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}