apache/hadoop · error · IOException

Interrupted waiting for doFinalize() response

Error message

Interrupted waiting for doFinalize() response

What it means

QuorumJournalManager.doFinalize() finalizes the upgrade on every JournalNode and waits for ALL of them within dfs.qjm.operations.timeout. InterruptedException means the finalization-driving thread was cancelled, and it is converted to IOException.

Source

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

    } catch (InterruptedException e) {
      throw new IOException("Interrupted waiting for doUpgrade() response");
    } catch (TimeoutException e) {
      throw new IOException("Timed out waiting for doUpgrade() response");
    }
  }
  
  @Override
  public void doFinalize() throws IOException {
    QuorumCall<AsyncLogger, Void> call = loggers.doFinalize();
    try {
      call.waitFor(loggers.size(), loggers.size(), 0, timeoutMs,
          "doFinalize");
      
      if (call.countExceptions() > 0) {
        call.rethrowException("Could not finalize one or more JournalNodes");
      }
    } catch (InterruptedException e) {
      throw new IOException("Interrupted waiting for doFinalize() response");
    } catch (TimeoutException e) {
      throw new IOException("Timed out waiting for doFinalize() response");
    }
  }
  
  @Override
  public boolean canRollBack(StorageInfo storage, StorageInfo prevStorage,
      int targetLayoutVersion) throws IOException {
    QuorumCall<AsyncLogger, Boolean> call = loggers.canRollBack(storage,
        prevStorage, targetLayoutVersion);
    try {
      call.waitFor(loggers.size(), loggers.size(), 0, timeoutMs,
          "lockSharedStorage");
      
      if (call.countExceptions() > 0) {
        call.rethrowException("Could not check if roll back possible for"
            + " one or more JournalNodes");
      }

View on GitHub (pinned to 2add963021)

Solutions

  1. Stop the interrupting source and rerun finalization to completion.
  2. Inspect JournalNode directory state afterwards (previous/ removal) to confirm whether finalize partially applied.
  3. Ensure all JournalNodes are reachable so the rerun finishes within dfs.qjm.operations.timeout.
Defensive patterns

Strategy: retry

Try / catch

try {
  qjm.doFinalize();
} catch (IOException e) {
  if (Thread.currentThread().isInterrupted()
      || (e.getMessage() != null && e.getMessage().contains("Interrupted waiting for doFinalize"))) {
    Thread.currentThread().interrupt();
    // finalization cancelled: check previous/ dirs on JNs, then rerun
    throw new IllegalStateException("finalize cancelled; rerun to completion", e);
  }
  throw e;
}

Prevention

When it happens

Trigger: The upgrade finalization command is interrupted while JournalNodes are still finalizing — operator cancels 'hdfs dfsadmin -finalizeUpgrade'-driven flow, automation kills the step, or the JVM shuts down.

Common situations: Cancelled or timed-out upgrade finalization scripts; interrupted maintenance windows.

Related errors


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