{"record":{"id":"dd1d777a4a5911bc","repo":"apache/hadoop","slug":"stream-is-closed-dd1d77","errorCode":null,"errorMessage":"Stream is closed!","messagePattern":"Stream is closed!","errorType":"validation","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsInputStream.java","lineNumber":250,"sourceCode":"  /**\n   * Retrieves the handler responsible for processing vectored read requests.\n   * @return the {@link VectoredReadHandler} instance associated with the buffer manager.\n   */\n  VectoredReadHandler getVectoredReadHandler() {\n    return getReadBufferManager().getVectoredReadHandler();\n  }\n\n  @Override\n  public int read(long position, byte[] buffer, int offset, int length)\n      throws IOException {\n    // When bufferedPreadDisabled = true, this API does not use any shared buffer,\n    // cursor position etc. So this is implemented as NOT synchronized. HBase\n    // kind of random reads on a shared file input stream will greatly get\n    // benefited by such implementation.\n    // Strict close check at the begin of the API only not for the entire flow.\n    synchronized (this) {\n      if (closed) {\n        throw new IOException(FSExceptionMessages.STREAM_IS_CLOSED);\n      }\n    }\n    LOG.debug(\"pread requested offset = {} len = {} bufferedPreadDisabled = {}\",\n        offset, length, bufferedPreadDisabled);\n    if (!bufferedPreadDisabled) {\n      return super.read(position, buffer, offset, length);\n    }\n    validatePositionedReadArgs(position, buffer, offset, length);\n    if (length == 0) {\n      return 0;\n    }\n    if (streamStatistics != null) {\n      streamStatistics.readOperationStarted();\n    }\n    TracingContext tc = new TracingContext(tracingContext);\n    tc.setReadType(ReadType.DIRECT_READ);\n    int bytesRead = readRemote(position, buffer, offset, length, tc);\n    if (statistics != null) {","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsInputStream.java#L232-L268","documentation":"Error \"Stream is closed!\" thrown in apache/hadoop.","triggerScenarios":"A read is attempted on an ABFS input stream that was already closed.","commonSituations":"See trigger scenarios.","solutions":["Do not read from the stream after close(); open a new stream instead.","Check application logic for use-after-close, especially in finally blocks and retries."],"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-22T20:17:22.307Z"}