{"record":{"id":"307d6e6c425f4fc3","repo":"apache/hadoop","slug":"waiting-for-writer-thread-is-interrupted","errorCode":null,"errorMessage":"Waiting for writer thread is interrupted.","messagePattern":"Waiting for writer thread is interrupted\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java","lineNumber":279,"sourceCode":"          (!thread.isAlive())) {\n        if (writer.compareAndSet(thread, null)) {\n          return; // Done\n        }\n        // The writer changed.  Go back to the start of the loop and attempt to\n        // stop the new writer.\n        continue;\n      }\n      thread.interrupt();\n      try {\n        thread.join(xceiverStopTimeout);\n        if (thread.isAlive()) {\n          // Our thread join timed out.\n          final String msg = \"Join on writer thread \" + thread + \" timed out\";\n          DataNode.LOG.warn(msg + \"\\n\" + StringUtils.getStackTrace(thread));\n          throw new IOException(msg);\n        }\n      } catch (InterruptedException e) {\n        throw new IOException(\"Waiting for writer thread is interrupted.\");\n      }\n    }\n  }\n\n  @Override  // Object\n  public int hashCode() {\n    return super.hashCode();\n  }\n\n  @Override // ReplicaInPipeline\n  public ReplicaOutputStreams createStreams(boolean isCreate,\n      DataChecksum requestedChecksum) throws IOException {\n    final File blockFile = getBlockFile();\n    final File metaFile = getMetaFile();\n    if (DataNode.LOG.isDebugEnabled()) {\n      DataNode.LOG.debug(\"writeTo blockfile is \" + blockFile +\n                         \" of size \" + blockFile.length());\n      DataNode.LOG.debug(\"writeTo metafile is \" + metaFile +","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java#L261-L297","documentation":"Error \"Waiting for writer thread is interrupted.\" thrown in apache/hadoop.","triggerScenarios":"The thread waiting for the replica writer to complete is interrupted, commonly during DataNode shutdown or write abort.","commonSituations":"Waiting for the writer thread was interrupted, usually during shutdown or pipeline recovery. Safe to ignore during planned restarts.","solutions":["Usually benign during shutdown or aborted writes; no action required.","If recurring without shutdown, find the source of interrupts in the surrounding pipeline handling."],"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"}