{"record":{"id":"70361ba8b2c12cb5","repo":"apache/hadoop","slug":"interrupted-waiting-timeoutms-ms-for-a-quor","errorCode":null,"errorMessage":"Interrupted waiting \" + timeoutMs + \"ms for a quorum of nodes to respond.","messagePattern":"Interrupted waiting \" \\+ timeoutMs \\+ \"ms for a quorum of nodes to respond\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/AsyncLoggerSet.java","lineNumber":135,"sourceCode":"   * @param q the quorum call\n   * @param timeoutMs the number of millis to wait\n   * @param operationName textual description of the operation, for logging\n   * @return a map of successful results\n   * @throws QuorumException if a quorum doesn't respond with success\n   * @throws IOException if the thread is interrupted or times out\n   */\n  <V> Map<AsyncLogger, V> waitForWriteQuorum(QuorumCall<AsyncLogger, V> q,\n      int timeoutMs, String operationName) throws IOException {\n    int majority = getMajoritySize();\n    try {\n      q.waitFor(\n          loggers.size(), // either all respond \n          majority, // or we get a majority successes\n          majority, // or we get a majority failures,\n          timeoutMs, operationName);\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      throw new IOException(\"Interrupted waiting \" + timeoutMs + \"ms for a \" +\n          \"quorum of nodes to respond.\");\n    } catch (TimeoutException e) {\n      throw new IOException(\"Timed out waiting \" + timeoutMs + \"ms for a \" +\n          \"quorum of nodes to respond.\");\n    }\n    \n    if (q.countSuccesses() < majority) {\n      q.rethrowException(\"Got too many exceptions to achieve quorum size \" +\n          getMajorityString());\n    }\n    \n    return q.getResults();\n  }\n  \n  /**\n   * @return the number of nodes which are required to obtain a quorum.\n   */\n  int getMajoritySize() {","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/AsyncLoggerSet.java#L117-L153","documentation":"AsyncLoggerSet.waitForWriteQuorum() is how QuorumJournalManager commits edits: it waits until all JournalNodes answer or a majority succeed/fail. InterruptedException means the waiting thread (normally the NameNode's edit-log writer) was interrupted mid-wait; the handler restores the interrupt flag and converts it to IOException.","triggerScenarios":"The FSEditLog writer thread is interrupted while a quorum write is in flight — typically NameNode shutdown, HA failover aborting the writer, or tooling cancelling the thread.","commonSituations":"Active NN shutdown or ZKFC-initiated failover during heavy edit traffic; restart of the active during metadata operations; expected and benign when it lines up with an intentional stop/failover.","solutions":["Correlate the timestamp with NN shutdown or failover events; if they match, no action is needed.","If it happens spontaneously, take a jstack of the NameNode to find which thread interrupts the edit-log writer.","After failover, confirm the new active performed segment recovery (automatic via QJM epoch recovery)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  Map<AsyncLogger, V> results = loggers.waitForWriteQuorum(call, timeoutMs, op);\n} catch (IOException e) {\n  if (Thread.currentThread().isInterrupted()\n      || (e.getMessage() != null && e.getMessage().startsWith(\"Interrupted waiting\"))) {\n    Thread.currentThread().interrupt();\n    // cancellation (shutdown/failover): stop cleanly, do not retry the write\n    throw new CancellationException(\"quorum wait interrupted: \" + e.getMessage());\n  }\n  throw e; // real I/O failure: handle separately\n}","preventionTips":["Never interrupt the NameNode edit-log writer except for shutdown/failover; document that contract in tooling.","Correlate this exception with shutdown/failover events before debugging it as a fault.","Keep HA failover thresholds above expected quorum-write latency so writers are not cancelled mid-commit."],"tags":["hdfs","qjm","journal-node","ha","interrupted","edit-log"],"backgroundTag":"operation-interrupted","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}