{"record":{"id":"ca4579657ba10fb7","repo":"apache/hadoop","slug":"stream-is-closed-ca4579","errorCode":null,"errorMessage":"Stream is closed!","messagePattern":"Stream is closed!","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSInputStream.java","lineNumber":214,"sourceCode":"      partRemaining--;\n    }\n\n    if (statistics != null && byteRead >= 0) {\n      statistics.incrementBytesRead(byteRead);\n    }\n    return byteRead;\n  }\n\n\n  /**\n   * Verify that the input stream is open. Non blocking; this gives\n   * the last state of the volatile {@link #closed} field.\n   *\n   * @throws IOException if the connection is closed.\n   */\n  private void checkNotClosed() throws IOException {\n    if (closed) {\n      throw new IOException(FSExceptionMessages.STREAM_IS_CLOSED);\n    }\n  }\n\n  @Override\n  public synchronized int read(byte[] buf, int off, int len)\n      throws IOException {\n    checkNotClosed();\n\n    if (buf == null) {\n      throw new NullPointerException();\n    } else if (off < 0 || len < 0 || len > buf.length - off) {\n      throw new IndexOutOfBoundsException();\n    } else if (len == 0) {\n      return 0;\n    }\n\n    int bytesRead = 0;\n    // Not EOF, and read not done","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSInputStream.java#L196-L232","documentation":"Error \"Stream is closed!\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSInputStream.java:214 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not read from a stream after close(); check the calling code for use-after-close or premature close of the input stream."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}