{"record":{"id":"b1fea27b6de8cae6","repo":"apache/hadoop","slug":"another-reconfiguration-task-is-running","errorCode":null,"errorMessage":"Another reconfiguration task is running.","messagePattern":"Another reconfiguration task is running\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurableBase.java","lineNumber":179,"sourceCode":"      }\n    }\n  }\n\n  /**\n   * Start a reconfiguration task to reload configuration in background.\n   * @throws IOException raised on errors performing I/O.\n   */\n  public void startReconfigurationTask() throws IOException {\n    synchronized (reconfigLock) {\n      if (!shouldRun) {\n        String errorMessage = \"The server is stopped.\";\n        LOG.warn(errorMessage);\n        throw new IOException(errorMessage);\n      }\n      if (reconfigThread != null) {\n        String errorMessage = \"Another reconfiguration task is running.\";\n        LOG.warn(errorMessage);\n        throw new IOException(errorMessage);\n      }\n      reconfigThread = new ReconfigurationThread(this);\n      reconfigThread.setDaemon(true);\n      reconfigThread.setName(\"Reconfiguration Task\");\n      reconfigThread.start();\n      startTime = Time.now();\n    }\n  }\n\n  public ReconfigurationTaskStatus getReconfigurationTaskStatus() {\n    synchronized (reconfigLock) {\n      if (reconfigThread != null) {\n        return new ReconfigurationTaskStatus(startTime, 0, null);\n      }\n      return new ReconfigurationTaskStatus(startTime, endTime, status);\n    }\n  }\n","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurableBase.java#L161-L197","documentation":"Thrown by ReconfigurableBase.startReconfigurationTask() when a background ReconfigurationThread is already active for this service (reconfigThread != null under reconfigLock). The class permits only one in-flight reconfiguration at a time, so a second start attempt is rejected with an IOException before any thread is created. The running status is observable via getReconfigurationTaskStatus(), which reports endTime 0 while a task is running.","triggerScenarios":"Calling startReconfigurationTask() again before the first task completed and before shutdownReconfigurationTask() cleared it; repeated admin 'apply config' RPCs (NameNode/DataNode/KMS style) where a client retries or double-submits while the first reload is still executing.","commonSituations":"Double-clicking a config-apply button or re-running a refresh script; automation/monitoring that re-triggers reconfiguration on timeout; a slow reconfigurePropertyImpl (e.g. a property whose apply does I/O) widening the window in which a second call lands.","solutions":["Before starting, call getReconfigurationTaskStatus() and only invoke startReconfigurationTask() when no task is running (status startTime==0, or endTime>0 from a completed task)","Wait for the in-flight task to finish by polling getReconfigurationTaskStatus() until endTime becomes non-zero, then start the new task","If the prior task is stuck, call shutdownReconfigurationTask() (it joins the thread and nulls reconfigThread) before starting again","Treat the exception as an idempotency signal: catch it, log, and skip, since a reload is already in progress"],"exampleFix":"// before\nserver.startReconfigurationTask(); // throws IOException if one is already running\n\n// after\nReconfigurationTaskStatus s = server.getReconfigurationTaskStatus();\nboolean running = s.getStartTime() > 0 && s.getEndTime() == 0;\nif (!running) {\n  server.startReconfigurationTask();\n} else {\n  LOG.info(\"Reconfiguration already in progress; skipping.\");\n}","handlingStrategy":"validation","validationCode":"// ReconfigurableBase reports endTime==0 while a task is running\nReconfigurationTaskStatus s = server.getReconfigurationTaskStatus();\nif (s.getStartTime() > 0 && s.getEndTime() == 0) {\n  // a reconfiguration task is in progress; do NOT call startReconfigurationTask()\n}","typeGuard":null,"tryCatchPattern":"try {\n  server.startReconfigurationTask();\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Another reconfiguration task\")) {\n    LOG.info(\"Reconfiguration already running; skipping duplicate trigger.\");\n  } else {\n    throw e;\n  }\n}","preventionTips":["Make reconfiguration triggers idempotent: check getReconfigurationTaskStatus() before starting","Poll task status until endTime is non-zero before issuing the next reload","Debounce duplicate admin/RPC submissions in the UI or script layer"],"tags":["reconfiguration","concurrency","configuration","hadoop"],"backgroundTag":"operation-already-in-progress","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}