{"record":{"id":"1911254d3c0e5345","repo":"apache/hadoop","slug":"interrupted-waiting-for-doupgrade-response","errorCode":null,"errorMessage":"Interrupted waiting for doUpgrade() response","messagePattern":"Interrupted waiting for doUpgrade\\(\\) response","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java","lineNumber":696,"sourceCode":"    } catch (InterruptedException e) {\n      throw new IOException(\"Interrupted waiting for doPreUpgrade() response\");\n    } catch (TimeoutException e) {\n      throw new IOException(\"Timed out waiting for doPreUpgrade() response\");\n    }\n  }\n\n  @Override\n  public void doUpgrade(Storage storage) throws IOException {\n    QuorumCall<AsyncLogger, Void> call = loggers.doUpgrade(storage);\n    try {\n      call.waitFor(loggers.size(), loggers.size(), 0, timeoutMs,\n          \"doUpgrade\");\n      \n      if (call.countExceptions() > 0) {\n        call.rethrowException(\"Could not perform upgrade of one or more JournalNodes\");\n      }\n    } catch (InterruptedException e) {\n      throw new IOException(\"Interrupted waiting for doUpgrade() response\");\n    } catch (TimeoutException e) {\n      throw new IOException(\"Timed out waiting for doUpgrade() response\");\n    }\n  }\n  \n  @Override\n  public void doFinalize() throws IOException {\n    QuorumCall<AsyncLogger, Void> call = loggers.doFinalize();\n    try {\n      call.waitFor(loggers.size(), loggers.size(), 0, timeoutMs,\n          \"doFinalize\");\n      \n      if (call.countExceptions() > 0) {\n        call.rethrowException(\"Could not finalize one or more JournalNodes\");\n      }\n    } catch (InterruptedException e) {\n      throw new IOException(\"Interrupted waiting for doFinalize() response\");\n    } catch (TimeoutException e) {","sourceCodeStart":678,"sourceCodeEnd":714,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java#L678-L714","documentation":"QuorumJournalManager.doUpgrade() applies the storage upgrade on every JournalNode and waits for ALL of them within dfs.qjm.operations.timeout. InterruptedException means the upgrade-driving thread was cancelled mid-wait and is converted to IOException.","triggerScenarios":"The NameNode upgrade command is interrupted while JournalNodes are still upgrading their on-disk layouts — operator cancellation, automation timeout, or JVM shutdown.","commonSituations":"Cancelled or timed-out rolling upgrade orchestration; scripts killing the namenode during the upgrade window.","solutions":["Stop the interrupting source and rerun the upgrade command to completion.","Inspect each JournalNode's directory state afterwards; upgrade steps are resumable but should not be left half-applied.","Verify all JournalNodes are healthy so the rerun finishes within dfs.qjm.operations.timeout."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  qjm.doUpgrade(storage);\n} catch (IOException e) {\n  if (Thread.currentThread().isInterrupted()\n      || (e.getMessage() != null && e.getMessage().contains(\"Interrupted waiting for doUpgrade\"))) {\n    Thread.currentThread().interrupt();\n    throw new IllegalStateException(\n        \"upgrade cancelled; inspect JN layout state and rerun\", e);\n  }\n  throw e;\n}","preventionTips":["Run upgrades in windows where orchestration will not kill the namenode thread.","Treat 'Interrupted waiting for doUpgrade' as a cancelled operation, not a JN fault; rerun after inspection."],"tags":["hdfs","qjm","journal-node","upgrade","interrupted","ha"],"backgroundTag":"operation-interrupted","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}