{"record":{"id":"c342cc7d5e0f514c","repo":"prestodb/presto","slug":"stream-is-closed","errorCode":null,"errorMessage":"Stream is closed","messagePattern":"Stream is closed","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/s3/PrestoS3FileSystem.java","lineNumber":1212,"sourceCode":"            catch (Exception e) {\n                throw propagate(e);\n            }\n        }\n\n        private void closeStream()\n        {\n            if (in != null) {\n                abortStream(in);\n                in = null;\n                STATS.connectionReleased();\n            }\n        }\n\n        private void checkClosed()\n                throws IOException\n        {\n            if (closed.get()) {\n                throw new IOException(STREAM_IS_CLOSED);\n            }\n        }\n\n        private static void abortStream(InputStream in)\n        {\n            try {\n                if (in instanceof S3ObjectInputStream) {\n                    ((S3ObjectInputStream) in).abort();\n                }\n                else {\n                    in.close();\n                }\n            }\n            catch (IOException | AbortedException ignored) {\n                // thrown if the current thread is in the interrupted state\n            }\n        }\n","sourceCodeStart":1194,"sourceCodeEnd":1230,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/s3/PrestoS3FileSystem.java#L1194-L1230","documentation":"Stream-state guard inside PrestoS3FileSystem's input stream: an operation was attempted after the stream had already been closed (closed flag set). The constant STREAM_IS_CLOSED makes this a sentinel IllegalStateException-style check; the fault is calling read/skip/positioning methods on a consumed stream.","triggerScenarios":"Thrown at presto-hive/src/main/java/com/facebook/presto/hive/s3/PrestoS3FileSystem.java:1212 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not reuse the input stream after closing it","Fix resource lifecycle so readers close exactly once, at the end"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}