{"record":{"id":"e5cce2a6952b3d12","repo":"apache/druid","slug":"resume-command-was-not-accepted-within-5-seconds","errorCode":null,"errorMessage":"Resume command was not accepted within 5 seconds","messagePattern":"Resume command was not accepted within 5 seconds","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java","lineNumber":2185,"sourceCode":"  {\n    authorizationCheck(req);\n    resume();\n    return Response.status(Response.Status.OK).build();\n  }\n\n\n  @VisibleForTesting\n  public void resume() throws InterruptedException\n  {\n    pauseLock.lockInterruptibly();\n    try {\n      pauseRequested = false;\n      shouldResume.signalAll();\n\n      long nanos = TimeUnit.SECONDS.toNanos(5);\n      while (isPaused()) {\n        if (nanos <= 0L) {\n          throw new RuntimeException(\"Resume command was not accepted within 5 seconds\");\n        }\n        nanos = shouldResume.awaitNanos(nanos);\n      }\n    }\n    finally {\n      pauseLock.unlock();\n    }\n  }\n\n\n  @GET\n  @Path(\"/time/start\")\n  @Produces(MediaType.APPLICATION_JSON)\n  public DateTime getStartTime(@Context final HttpServletRequest req)\n  {\n    authorizationCheck(req);\n    return startTime;\n  }","sourceCodeStart":2167,"sourceCodeEnd":2203,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java#L2167-L2203","documentation":"In SeekableStreamIndexTaskRunner.pause(), after signaling shouldResume, the runner waits up to 5 seconds (awaitNanos loop) for the paused state to actually clear. If the task is still isPaused() after 5 seconds, it throws a RuntimeException because the resume command was not honored — usually the consumer's poll loop is stuck or the pause/resume protocol with the record supplier failed.","triggerScenarios":"Calling the task resume operation (or supervisor-triggered resume) while the task is paused, and within 5 seconds the ingestion loop does not observe/resume; typically because the task thread is blocked in a long Kafka/Kinesis poll, is hung on broker IO, or a previous pause signal raced with shutdown.","commonSituations":"Broker/network stall during pause; very long poll timeout or huge fetch causing slow resume; resume invoked concurrently with task shutdown/kill; deadlock between pauseLock and supplier threads under load.","solutions":["Retry the resume call; transient pauses often clear once the consumer poll completes.","Check task logs for the poll loop or record supplier being stuck (network issues, broker down) and restore broker connectivity.","Restart/resume the task via supervisor so a fresh ingestion thread takes over the paused one.","If reproducible, tune poll/fetch timeouts (e.g. pollTimeout, fetch max wait) so resume can complete within the 5s window."],"exampleFix":"// before: resume during a stuck task\ncurl -X POST 'http://middlemanager:8091/druid/worker/v1/task/<taskId>/resume'\n// after: verify broker connectivity first, or reset via supervisor\ncurl -X POST 'http://overlord:8087/druid/indexer/v1/supervisor/my-supervisor/reset'","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { resume(taskId); } catch (RuntimeException e) { if (e.getMessage().contains(\"Resume command was not accepted\")) { retryWithBackoff(() -> resume(taskId), 3); } else { throw e; } }","preventionTips":["Check broker/network health before pause/resume operations","Avoid pausing tasks during shutdown or maintenance windows","Keep consumer poll/fetch timeouts comfortably below 5s"],"tags":["druid","kafka","kinesis","pause-resume","timeout"],"backgroundTag":"request-timeout","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}