apache/hadoop · error · IOException

Interrupted while determining if JNs have data

Error message

Interrupted while determining if JNs have data

What it means

QJM.hasSomeData() asks each JournalNode whether it already holds data (this drives the 'Re-format filesystem?' prompt before formatting). The wait was interrupted: the querying thread was cancelled, typically aborting the format/bootstrap step, and the InterruptedException is converted to IOException.

Source

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

      throw new IOException("Interrupted waiting for format() response");
    } catch (TimeoutException e) {
      throw new IOException("Timed out waiting for format() response");
    }
    
    if (call.countExceptions() > 0) {
      call.rethrowException("Could not format one or more JournalNodes");
    }
  }

  @Override
  public boolean hasSomeData() throws IOException {
    QuorumCall<AsyncLogger, Boolean> call =
        loggers.isFormatted();

    try {
      call.waitFor(loggers.size(), 0, 0, timeoutMs, "hasSomeData");
    } catch (InterruptedException e) {
      throw new IOException("Interrupted while determining if JNs have data");
    } catch (TimeoutException e) {
      throw new IOException("Timed out waiting for response from loggers");
    }
    
    if (call.countExceptions() > 0) {
      call.rethrowException(
          "Unable to check if JNs are ready for formatting");
    }
    
    // If any of the loggers returned with a non-empty manifest, then
    // we should prompt for format.
    for (Boolean hasData : call.getResults().values()) {
      if (hasData) {
        return true;
      }
    }

    // Otherwise, none were formatted, we can safely format.

View on GitHub (pinned to 2add963021)

Solutions

  1. Rerun the format/bootstrap command to completion with nothing interrupting it.
  2. If the interrupt was unexpected, find the source (shutdown hook, orchestration kill) in the NN logs.
  3. Verify all JournalNodes are reachable so the rerun finishes within dfs.qjm.operations.timeout.
Defensive patterns

Strategy: retry

Try / catch

try {
  boolean hasData = qjm.hasSomeData();
} catch (IOException e) {
  if (Thread.currentThread().isInterrupted()
      || (e.getMessage() != null && e.getMessage().contains("Interrupted while determining"))) {
    Thread.currentThread().interrupt();
    // bootstrap step cancelled: rerun the format flow when not interrupted
    throw new IllegalStateException("hasSomeData check cancelled; rerun bootstrap", e);
  }
  throw e;
}

Prevention

When it happens

Trigger: The NameNode bootstrap/format thread is interrupted while checking JournalNodes for existing data — the user aborts namenode -format, automation kills the step, or a test harness times out.

Common situations: Cancelled cluster bootstrap scripts; interrupted HA re-format workflows; CI harnesses interrupting format commands.

Related errors


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