{"record":{"id":"a371df31e451a3ee","repo":"databendlabs/databend","slug":"executortask-none-unreachable","errorCode":null,"errorMessage":"ExecutorTask::None => unreachable!()","messagePattern":"ExecutorTask::None => unreachable!\\(\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/query/service/src/pipelines/executor/queries_executor_tasks.rs","lineNumber":364,"sourceCode":"            }\n        }\n\n        ExecutorTask::None\n    }\n\n    pub fn push_task(&mut self, worker_id: usize, task: ExecutorTask) {\n        self.tasks_size += 1;\n        debug_assert!(\n            worker_id < self.workers_sync_tasks.len(),\n            \"out of index, {}, {}\",\n            worker_id,\n            self.workers_sync_tasks.len()\n        );\n        let sync_queue = &mut self.workers_sync_tasks[worker_id];\n        let completed_queue = &mut self.workers_completed_async_tasks[worker_id];\n        let async_queue = &mut self.workers_async_tasks[worker_id];\n        match task {\n            ExecutorTask::None => unreachable!(),\n            ExecutorTask::Sync(processor) => sync_queue.push_back(processor),\n            ExecutorTask::Async(processor) => async_queue.push_back(processor),\n            ExecutorTask::AsyncCompleted(task) => completed_queue.push_back(task),\n        }\n    }\n}\n","sourceCodeStart":346,"sourceCodeEnd":371,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/service/src/pipelines/executor/queries_executor_tasks.rs#L346-L371","documentation":"This is a Rust `unreachable!()` panic in `QueriesExecutorTasks::push_task`. The `ExecutorTask` enum has a `None` variant used as a placeholder/empty state, and the executor's internal invariant is that only real tasks (Sync, Async, AsyncCompleted) are ever pushed onto a worker's queue. Pushing `ExecutorTask::None` indicates an executor bookkeeping bug.","triggerScenarios":"Calling `push_task` with an `ExecutorTask::None` value, which should only happen if the executor's scheduling logic built or forwarded a placeholder task instead of an actual processor/completion notification.","commonSituations":"Custom pipeline/executor modifications in the Databend query engine, or a bug in task scheduling where a slot initialized as `None` is pushed without being replaced by a real task.","solutions":["Inspect the caller of `push_task` to find where an `ExecutorTask::None` was produced instead of a real task","Guard call sites with `if !matches!(task, ExecutorTask::None)` before pushing, or return a proper error instead of panicking","Reproduce with the failing query and enable executor debug logs (trace!) to trace which scheduling step emitted the None task","Check for recent regressions in the queries executor refactor in src/query/service/src/pipelines/executor/"],"exampleFix":"// before\nmatch task {\n    ExecutorTask::None => unreachable!(),\n    ExecutorTask::Sync(p) => sync_queue.push_back(p),\n    ...\n}\n// after\nmatch task {\n    ExecutorTask::None => return Err(ErrorCode::Internal(\"push_task called with ExecutorTask::None\")),\n    ExecutorTask::Sync(p) => sync_queue.push_back(p),\n    ...\n}","handlingStrategy":"type-guard","validationCode":"if matches!(task, ExecutorTask::None) { return Err(ErrorCode::Internal(\"task is ExecutorTask::None\")); }","typeGuard":"fn is_real_task(t: &ExecutorTask) -> bool { !matches!(t, ExecutorTask::None) }","tryCatchPattern":null,"preventionTips":["Never push default/placeholder ExecutorTask values; initialize worker slots with real tasks or Option","Add debug_assert!(!matches!(task, ExecutorTask::None)) at all push_task call sites","Cover executor scheduling paths with tests that enumerate all ExecutorTask variants"],"tags":["rust","panic","executor","internal-bug"],"backgroundTag":"internal-invariant-violation","analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}