risingwavelabs/risingwave · error · BatchError

task {:?} not found

Error message

task {:?} not found

What it means

A lookup guard in TaskManager::check_if_task_running: the requested TaskId is absent from the manager's task registry, so the state check fails with 'task {:?} not found'. It fires when a client queries status or output for a task that was never created on this compute node, or whose entry was already removed after completion/cleanup (or after a compute-node restart lost in-memory state). The offending input is a stale or never-registered task_id.

Source

Thrown at src/batch/src/task/task_manager.rs:273

                tracing::trace!("Removed task: {:?}", task.get_task_id());
                // Use `cancel` rather than `abort` here since this is not an error which should be
                // propagated to upstream.
                task.cancel();
                if let Some(heartbeat_join_handle) = task.heartbeat_join_handle() {
                    heartbeat_join_handle.abort();
                }
            }
            None => {
                warn!("Task {:?} not found for cancel", sid)
            }
        };
    }

    /// Returns error if task is not running.
    pub fn check_if_task_running(&self, task_id: &TaskId) -> Result<()> {
        match self.tasks.lock().get(task_id) {
            Some(task) => task.check_if_running(),
            None => bail!("task {:?} not found", task_id),
        }
    }

    pub fn check_if_task_aborted(&self, task_id: &TaskId) -> Result<bool> {
        match self.tasks.lock().get(task_id) {
            Some(task) => task.check_if_aborted(),
            None => bail!("task {:?} not found", task_id),
        }
    }

    #[cfg(test)]
    async fn wait_until_task_aborted(&self, task_id: &TaskId) -> Result<()> {
        use std::time::Duration;
        loop {
            match self.tasks.lock().get(task_id) {
                Some(task) => {
                    let ret = task.check_if_aborted();
                    match ret {

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Verify the task was dispatched to this specific compute node; task state is per-node and not shared across the cluster
  2. Handle node restarts: in-memory task state is lost on restart, so treat 'not found' as task-unknown and re-derive status from the meta service
  3. Check that the task was not already completed and garbage-collected before the status query arrived
  4. Ensure the scheduler reads the task status before declaring failure, so completed tasks are recognized rather than reported as missing
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/batch/src/task/task_manager.rs:273 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/7b08710c1d3ed327. Report an issue: GitHub.