{"record":{"id":"52ece3b3eecad75f","repo":"prestodb/presto","slug":"java-io-ioexception-wrapped-in-uncheckedioexcepti-52ece3","errorCode":null,"errorMessage":"java.io.IOException (wrapped in UncheckedIOException)","messagePattern":"java\\.io\\.IOException \\(wrapped in UncheckedIOException\\)","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/reader/LongBatchStreamReader.java","lineNumber":122,"sourceCode":"    }\n\n    @Override\n    public String toString()\n    {\n        return toStringHelper(this)\n                .addValue(streamDescriptor)\n                .toString();\n    }\n\n    @Override\n    public void close()\n    {\n        try (Closer closer = Closer.create()) {\n            closer.register(directReader::close);\n            closer.register(dictionaryReader::close);\n        }\n        catch (IOException e) {\n            throw new UncheckedIOException(e);\n        }\n    }\n\n    @Override\n    public long getRetainedSizeInBytes()\n    {\n        return INSTANCE_SIZE + directReader.getRetainedSizeInBytes() + dictionaryReader.getRetainedSizeInBytes();\n    }\n}\n","sourceCodeStart":104,"sourceCodeEnd":132,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/LongBatchStreamReader.java#L104-L132","documentation":"LongBatchStreamReader.close registers directReader::close and dictionaryReader::close with a Closer; any IOException thrown while closing the underlying ORC data streams is wrapped in an UncheckedIOException. This means a low-level I/O failure (disk error, already-closed channel, network filesystem issue) occurred during resource cleanup.","triggerScenarios":"close() is invoked (end of stripe/operator lifetime) and one of the inner streams' close throws IOException, e.g. releasing an encrypted/HDFS file handle that fails.","commonSituations":"HDFS/S3 connectivity drops while releasing readers; double-close bugs in custom data sources; intermittent NFS issues during query teardown.","solutions":["Inspect the cause via UncheckedIOException.getCause() to find the real IOException and its data source id","Retry the query if transient (HDFS/network flake); check NameNode/datanode and S3 endpoint health","Ensure the OrcDataSource implementation is safe to close once and is not closed concurrently elsewhere","Upgrade to a Presto version where close failures during cleanup are logged instead of propagated"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { ... } catch (UncheckedIOException e) { log.warn(\"ORC reader close failed\", e.getCause()); /* transient: retry query */ }","preventionTips":["Check e.getCause() to diagnose the underlying IOException","Monitor HDFS/S3 health for transient close failures","Ensure OrcDataSource implementations are idempotent and single-close","Report persistent close failures; newer versions log instead of throwing"],"tags":["orc","io","unchecked-io-exception","resource-cleanup"],"backgroundTag":"ioexception-wrapped","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"}