apache/hadoop · error · IOException

Interrupted waiting for doPreUpgrade() response

Error message

Interrupted waiting for doPreUpgrade() response

What it means

QuorumJournalManager.doPreUpgrade() runs the pre-upgrade step on every JournalNode (finalizing the current edit segment and preparing current/previous directories) and waits for ALL of them within dfs.qjm.operations.timeout. InterruptedException means the upgrade-driving thread was cancelled mid-wait.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java:679

  }

  @VisibleForTesting
  AsyncLoggerSet getLoggerSetForTests() {
    return loggers;
  }

  @Override
  public void doPreUpgrade() throws IOException {
    QuorumCall<AsyncLogger, Void> call = loggers.doPreUpgrade();
    try {
      call.waitFor(loggers.size(), loggers.size(), 0, timeoutMs,
          "doPreUpgrade");
      
      if (call.countExceptions() > 0) {
        call.rethrowException("Could not do pre-upgrade of one or more JournalNodes");
      }
    } catch (InterruptedException e) {
      throw new IOException("Interrupted waiting for doPreUpgrade() response");
    } catch (TimeoutException e) {
      throw new IOException("Timed out waiting for doPreUpgrade() response");
    }
  }

  @Override
  public void doUpgrade(Storage storage) throws IOException {
    QuorumCall<AsyncLogger, Void> call = loggers.doUpgrade(storage);
    try {
      call.waitFor(loggers.size(), loggers.size(), 0, timeoutMs,
          "doUpgrade");
      
      if (call.countExceptions() > 0) {
        call.rethrowException("Could not perform upgrade of one or more JournalNodes");
      }
    } catch (InterruptedException e) {
      throw new IOException("Interrupted waiting for doUpgrade() response");
    } catch (TimeoutException e) {

View on GitHub (pinned to 2add963021)

Solutions

  1. Find and stop whatever interrupted the upgrade thread, then rerun the upgrade command to completion.
  2. After an interrupted pre-upgrade, inspect each JournalNode's directory state (current/previous) before rerunning.
  3. Ensure all JournalNodes are healthy so the rerun completes within dfs.qjm.operations.timeout.
Defensive patterns

Strategy: retry

Try / catch

try {
  qjm.doPreUpgrade();
} catch (IOException e) {
  if (Thread.currentThread().isInterrupted()
      || (e.getMessage() != null && e.getMessage().contains("Interrupted waiting for doPreUpgrade"))) {
    Thread.currentThread().interrupt();
    // upgrade cancelled: inspect JN dirs, then rerun the upgrade command
    throw new IllegalStateException("pre-upgrade cancelled; rerun to completion", e);
  }
  throw e;
}

Prevention

When it happens

Trigger: An HA rolling upgrade command (namenode upgrade path) is interrupted while JournalNodes are still preparing — the operator cancels the command, automation kills it, or the JVM shuts down.

Common situations: Rolling upgrade orchestration with aggressive timeouts; cancelled upgrade windows; scripts killing namenode processes mid-procedure.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/375edf411cbd800f. Report an issue: GitHub.