{"record":{"id":"662bee9cac43a8b1","repo":"apache/druid","slug":"killing-task-s-as-it-failed-to-return-start-time","errorCode":null,"errorMessage":"Killing task[%s] as it failed to return start time.","messagePattern":"Killing task\\[(.+?)\\] as it failed to return start time\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java","lineNumber":3739,"sourceCode":"        taskData.status = taskStorage.getStatus(taskId).get();\n      }\n    }\n\n    // update status of pending completion tasks in pendingCompletionTaskGroups\n    for (List<TaskGroup> taskGroups : pendingCompletionTaskGroups.values()) {\n      for (TaskGroup group : taskGroups) {\n        for (Entry<String, TaskData> entry : group.tasks.entrySet()) {\n          entry.getValue().status = taskStorage.getStatus(entry.getKey()).get();\n        }\n      }\n    }\n\n    final List<Either<Throwable, Boolean>> results = coalesceAndAwait(futures);\n    for (int i = 0; i < results.size(); i++) {\n      // Ignore return value; but kill tasks that failed to return anything at all.\n      if (results.get(i).isError()) {\n        String taskId = futureTaskIds.get(i);\n        log.noStackTrace().warn(results.get(i).error(), \"Killing task[%s] as it failed to return start time.\", taskId);\n        killTask(taskId, \"Failed to return start time: %s\", results.get(i).error().getMessage());\n      }\n    }\n  }\n\n  /**\n   * Checks the duration of {@link #activelyReadingTaskGroups}, requests them\n   * to checkpoint themselves if they have exceeded the specified run duration\n   * or if early stop has been requested. If checkpoint is successful, the\n   * {@link #partitionOffsets} are updated and checkpointed tasks are moved to\n   * {@link #pendingCompletionTaskGroups}.\n   */\n  private void checkTaskDuration() throws ExecutionException, InterruptedException\n  {\n    final List<ListenableFuture<Map<PartitionIdType, SequenceOffsetType>>> futures = new ArrayList<>();\n    final List<Integer> futureGroupIds = new ArrayList<>();\n\n    final boolean stopTasksEarly;","sourceCodeStart":3721,"sourceCodeEnd":3757,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java#L3721-L3757","documentation":"In SeekableStreamSupervisor, after collecting results from tasks reporting their start times, any task whose future completed with an error has no valid start time. The supervisor logs a warning and kills that task with a 'Failed to return start time' reason so the task can be relaunched cleanly. This is a supervisor-level recovery action, not necessarily a query failure.","triggerScenarios":"A Kafka/Kinesis read-only or read-write task's reportStartMetrics/start-time future completes with Either.error, e.g. the task threw while initializing its consumer, crashed before emitting its status, or its HTTP status endpoint returned an error.","commonSituations":"Tasks fail to start because of broker connectivity issues, expired/invalid credentials, a task container OOM, or deserialization errors in the stream partition records, so they never report a start time.","solutions":["Inspect the warning's attached exception and the killed task's logs to find the root cause of the task not reporting a start time.","Verify connectivity and credentials to the stream (Kafka brokers / Kinesis endpoint) from the task's middleManager/peons.","Check consumer configuration (bootstrap servers, region, ingestion spec offsets) and task memory settings; tasks will typically be recreated automatically by the supervisor."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep supervisor and task log retention long enough to correlate kill reasons with task crashes.","Ensure stream connectivity/credentials are valid before deploying ingestion specs.","Size task memory generously so startup completes and start times get reported."],"tags":["druid","kafka","kinesis","supervisor","task-lifecycle"],"backgroundTag":"task-startup-failed","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}