{"record":{"id":"7b08710c1d3ed327","repo":"risingwavelabs/risingwave","slug":"task-not-found","errorCode":null,"errorMessage":"task {:?} not found","messagePattern":"task (.+?) not found","errorType":"error_code","errorClass":"BatchError","httpStatus":null,"severity":"error","filePath":"src/batch/src/task/task_manager.rs","lineNumber":273,"sourceCode":"                tracing::trace!(\"Removed task: {:?}\", task.get_task_id());\n                // Use `cancel` rather than `abort` here since this is not an error which should be\n                // propagated to upstream.\n                task.cancel();\n                if let Some(heartbeat_join_handle) = task.heartbeat_join_handle() {\n                    heartbeat_join_handle.abort();\n                }\n            }\n            None => {\n                warn!(\"Task {:?} not found for cancel\", sid)\n            }\n        };\n    }\n\n    /// Returns error if task is not running.\n    pub fn check_if_task_running(&self, task_id: &TaskId) -> Result<()> {\n        match self.tasks.lock().get(task_id) {\n            Some(task) => task.check_if_running(),\n            None => bail!(\"task {:?} not found\", task_id),\n        }\n    }\n\n    pub fn check_if_task_aborted(&self, task_id: &TaskId) -> Result<bool> {\n        match self.tasks.lock().get(task_id) {\n            Some(task) => task.check_if_aborted(),\n            None => bail!(\"task {:?} not found\", task_id),\n        }\n    }\n\n    #[cfg(test)]\n    async fn wait_until_task_aborted(&self, task_id: &TaskId) -> Result<()> {\n        use std::time::Duration;\n        loop {\n            match self.tasks.lock().get(task_id) {\n                Some(task) => {\n                    let ret = task.check_if_aborted();\n                    match ret {","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/batch/src/task/task_manager.rs#L255-L291","documentation":"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.","triggerScenarios":"Thrown at src/batch/src/task/task_manager.rs:273 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the task was dispatched to this specific compute node; task state is per-node and not shared across the cluster","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","Check that the task was not already completed and garbage-collected before the status query arrived","Ensure the scheduler reads the task status before declaring failure, so completed tasks are recognized rather than reported as missing"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}