{"record":{"id":"b5390262ff5600b2","repo":"apache/hadoop","slug":"interrupted-waiting-for-getjournalctime-response","errorCode":null,"errorMessage":"Interrupted waiting for getJournalCTime() response","messagePattern":"Interrupted waiting for getJournalCTime\\(\\) 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":813,"sourceCode":"          timeoutMs, \"getJournalCTime\");\n      \n      if (call.countExceptions() > 0) {\n        call.rethrowException(\"Could not journal CTime for one \"\n            + \"more JournalNodes\");\n      }\n      \n      // Either they all return the same thing or this call fails, so we can\n      // just return the first result.\n      try {\n        DFSUtil.assertAllResultsEqual(call.getResults().values());\n      } catch (AssertionError ae) {\n        throw new IOException(\"Results differed for getJournalCTime\", ae);\n      }\n      for (Long result : call.getResults().values()) {\n        return result;\n      }\n    } catch (InterruptedException e) {\n      throw new IOException(\"Interrupted waiting for getJournalCTime() \" +\n          \"response\");\n    } catch (TimeoutException e) {\n      throw new IOException(\"Timed out waiting for getJournalCTime() \" +\n          \"response\");\n    }\n    \n    throw new AssertionError(\"Unreachable code.\");\n  }\n}\n","sourceCodeStart":795,"sourceCodeEnd":823,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java#L795-L823","documentation":"The getJournalCTime() quorum wait was interrupted — InterruptedException occurred while blocking for JournalNode responses and was wrapped in this IOException. It is not a fault in the JNs themselves; the waiting thread was told to stop.","triggerScenarios":"Thread interrupt during getJournalCTime(): NameNode shutdown or HA state transition during the upgrade-startup check, operator cancellation of startup/upgrade, or calling code interrupting its worker.","commonSituations":"NN startup with '-upgrade' aborted mid-check; systemd/upstart sends SIGTERM while the NN is checking shared edits; upgrade automation interrupts the NN on an outer deadline.","solutions":["Identify the interrupt source in adjacent log lines (shutdown, failover, operator action) and remove it.","Restart the NameNode / re-run the upgrade procedure in a stable environment where nothing will interrupt it.","If tooling-owned, raise the outer timeout instead of interrupting the thread performing the quorum wait.","Confirm the NN comes up cleanly afterwards; an interrupted pre-upgrade check leaves no partial state, so a clean retry is safe."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"static boolean isCTimeInterrupted(IOException ioe) {\n  return ioe.getMessage() != null\n      && ioe.getMessage().contains(\"Interrupted waiting for getJournalCTime\");\n}","tryCatchPattern":"try {\n  long ct = qjm.getJournalCTime();\n} catch (IOException ioe) {\n  if (isCTimeInterrupted(ioe)) {\n    Thread.currentThread().interrupt();\n    return OperationStatus.CANCELLED; // no partial state on the JNs\n  }\n  throw ioe;\n}","preventionTips":["Keep NN startup/upgrade uninterruptible: fix systemd/send signal timing so SIGTERM does not land mid-check.","A cancelled cTime check leaves no partial JN state — a clean restart of the procedure is safe."],"tags":["qjm","upgrade","ctime","interrupt","shutdown"],"backgroundTag":"thread-interrupted","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}