{"record":{"id":"5320f23f8e346c14","repo":"apache/druid","slug":"can-t-stop","errorCode":null,"errorMessage":"can't stop","messagePattern":"can't stop","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeAnnouncer.java","lineNumber":110,"sourceCode":"      long intervalMs = config.getService().getHealthCheckInterval().getMillis();\n      healthCheckExecutor.scheduleAtFixedRate(\n          this::updateHealthChecks,\n          0L,\n          intervalMs,\n          TimeUnit.MILLISECONDS\n      );\n      lifecycleLock.started();\n    }\n    finally {\n      lifecycleLock.exitStart();\n    }\n  }\n\n  @LifecycleStop\n  public void stop()\n  {\n    if (!lifecycleLock.canStop()) {\n      throw new ISE(\"can't stop\");\n    }\n\n    LOGGER.info(\"Stopping ConsulDruidNodeAnnouncer\");\n\n    healthCheckExecutor.shutdownNow();\n\n    // Wait for health check to finish so we don't deregister while health check is in progress\n    try {\n      if (!healthCheckExecutor.awaitTermination(EXECUTOR_TERMINATION_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {\n        LOGGER.warn(\"Health check executor did not terminate in time\");\n      }\n    }\n    catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      LOGGER.warn(\"Interrupted while waiting for health check termination\");\n    }\n\n    for (String serviceId : announcedNodes.keySet()) {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeAnnouncer.java#L92-L128","documentation":"Lifecycle guard in ConsulDruidNodeAnnouncer.stop(): the LifecycleStop hook detected via LifecycleLock that the announcer is not in a started state (never started, already stopped, or start still in progress), so a stop request is invalid. Usually indicates a lifecycle sequencing bug or a double stop; the code simply skips stopping.","triggerScenarios":"Thrown at extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDruidNodeAnnouncer.java:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Avoid duplicate stop() calls; ensure start() completed before stopping.","Inspect logs for the earlier lifecycle failure that left the lock in this state."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}