{"record":{"id":"201b9c98a181f56e","repo":"prestodb/presto","slug":"could-not-close-some-single-stream-spillers","errorCode":null,"errorMessage":"could not close some single stream spillers","messagePattern":"could not close some single stream spillers","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/spiller/GenericSpiller.java","lineNumber":92,"sourceCode":"                .map(SingleStreamSpiller::getSpilledPages)\n                .collect(toList());\n    }\n\n    @Override\n    public void commit()\n    {\n        checkNoSpillInProgress();\n        singleStreamSpillers.stream().forEach(SingleStreamSpiller::commit);\n    }\n\n    @Override\n    public void close()\n    {\n        try {\n            closer.close();\n        }\n        catch (IOException e) {\n            throw new RuntimeException(\"could not close some single stream spillers\", e);\n        }\n    }\n\n    private void checkNoSpillInProgress()\n    {\n        checkState(previousSpill.isDone(), \"previous spill still in progress\");\n    }\n}\n","sourceCodeStart":74,"sourceCodeEnd":101,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/spiller/GenericSpiller.java#L74-L101","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the cause chain of the RuntimeException for the underlying IOException and fix the storage issue (restore/unmount cleanly the spill volume).","Manually clean leftover spill files in the configured spill paths after the failure.","Check disk health (dmesg, smartctl) if repeated — hardware issues surface as close-time IOExceptions.","Upgrade Presto if hitting a known bug in closer/suppression handling for multi-channel spillers."],"exampleFix":"// no code fix; operational remedy\n// 1) find cause: grep the cause chain for the original IOException\n// 2) clean leftovers:\n// find /var/spill -name '*presto*' -mtime +1 -delete","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    spiller.close();\n} catch (RuntimeException e) {\n    log.warn(\"spiller close failed; possible leaked spill files\", e);\n    // continue teardown; clean spill dir of orphan files\n}","preventionTips":["Ensure spill volumes are healthy and mounted during query lifetime","Periodically sweep spill directories for orphaned files","Watch disk health metrics; close-time IOExceptions often indicate hardware/mount failures"],"tags":["spill","io","resource-cleanup","presto"],"backgroundTag":"io-close-failed","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"}