apache/druid · error · ISE

Last status of complete task is missing!

Error message

Last status of complete task is missing!

What it means

Thrown by ParallelIndexPhaseRunner.run when a subtask completes with TaskState.SUCCESS but its TaskStatusPlus payload (taskCompleteEvent.getLastStatus()) is null. The runner needs the status to inspect report data (e.g. multi-phase partitioning reports); without it, the phase cannot proceed. This indicates an inconsistent completion event rather than a task failure.

Source

Thrown at indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexPhaseRunner.java:155

      while (isRunning() && subTaskSpecIterator.hasNext() && taskMonitor.getNumRunningTasks() < maxNumConcurrentSubTasks) {
        submitNewTask(taskMonitor, subTaskSpecIterator.next());
      }

      LOG.info("Waiting for subTasks to be completed");
      while (isRunning()) {
        final SubTaskCompleteEvent<SubTaskType> taskCompleteEvent = taskCompleteEvents.poll(
            taskStatusCheckingPeriod,
            TimeUnit.MILLISECONDS
        );

        if (taskCompleteEvent != null) {
          final TaskState completeState = taskCompleteEvent.getLastState();
          getSubtaskCompletionCallback(taskCompleteEvent).run();
          switch (completeState) {
            case SUCCESS:
              final TaskStatusPlus completeStatus = taskCompleteEvent.getLastStatus();
              if (completeStatus == null) {
                throw new ISE("Last status of complete task is missing!");
              }
              if (!subTaskSpecIterator.hasNext()) {
                // We have no more subTasks to run
                if (taskMonitor.getNumRunningTasks() == 0 && taskCompleteEvents.isEmpty()) {
                  subTaskScheduleAndMonitorStopped = true;
                  if (subTaskSpecIterator.count == taskMonitor.getNumSucceededTasks()) {
                    // Succeeded
                    state = TaskState.SUCCESS;
                  } else {
                    // Failed
                    final ParallelIndexingPhaseProgress monitorStatus = taskMonitor.getProgress();
                    throw new ISE(
                        "Expected [%d] tasks to succeed, but we got [%d] succeeded tasks and [%d] failed tasks",
                        subTaskSpecIterator.count,
                        monitorStatus.getSucceeded(),
                        monitorStatus.getFailed()
                    );
                  }

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Check overlord logs for how the completion event for the subtask was recorded; restart the supervisor task to rerun the phase.
  2. Upgrade Druid — completion-event reporting bugs have been fixed in later versions.
  3. Verify no custom extensions replace the task runner/overlord completion path and drop lastStatus.
  4. If failover-induced, ensure the overlord's task storage (metadata DB) is healthy so completion events are fully persisted.

Example fix

// caller-side guard before trusting a completion event
if (event.getLastState() == TaskState.SUCCESS && event.getLastStatus() == null) {
  // resubmit/refresh the task status instead of feeding the event to the phase runner
  taskStatus = overlordClient.getTaskStatus(event.getId()).get();
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (event.getLastState() == TaskState.SUCCESS && event.getLastStatus() == null) {
  throw new IllegalStateException("completion event for " + event.getId() + " lacks status; refetch from overlord");
}

Try / catch

try {
  runner.run(toolbox);
} catch (ISE e) {
  if (e.getMessage().contains("Last status of complete task is missing")) {
    // refetch status from overlord and retry the phase
  } else throw e;
}

Prevention

When it happens

Trigger: A successful subtask completion event is delivered with a null lastStatus — typically when the overlord/task runner reports SUCCESS without attaching the TaskStatusPlus, or when completion bookkeeping (taskCompleteEvent) is constructed incompletely during coordinator/overlord failover.

Common situations: Overlord restart or HA failover while subtasks complete; custom or downgraded overlord/task runner clients that drop the status payload; bugs in task completion reporting plugins.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/3e4303b52c914f5f. Report an issue: GitHub.