{"record":{"id":"9774334bb453115b","repo":"databendlabs/databend","slug":"executortask-none-unreachable-977433","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/query_executor_tasks.rs","lineNumber":292,"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\n        match task {\n            ExecutorTask::None => unreachable!(),\n            ExecutorTask::Sync(processor) => sync_queue.push_back(processor),\n            ExecutorTask::Async(_) => unreachable!(\"used for new executor\"),\n            ExecutorTask::AsyncCompleted(task) => completed_queue.push_back(task),\n        }\n    }\n}\n","sourceCodeStart":274,"sourceCodeEnd":299,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/service/src/pipelines/executor/query_executor_tasks.rs#L274-L299","documentation":"Panic raised by `QueryExecutorTasks::push_task` when it receives `ExecutorTask::None`. The executor treats `None` as a sentinel that must never enter a worker's task queue; receiving it means the new query executor's task production logic violated its own invariant.","triggerScenarios":"Calling `push_task` on the new query executor's task set with an `ExecutorTask::None` value instead of a Sync/Async/AsyncCompleted task.","commonSituations":"Bug in the new executor's scheduling code, or third-party code/tests constructing tasks manually and pushing a default-initialized `None` task.","solutions":["Trace the producer of the task to find where `ExecutorTask::None` escaped the scheduler","Replace the sentinel with an explicit error at the call site rather than `unreachable!()`","Run the failing query with executor tracing enabled to identify the scheduling step","Check for refactoring regressions in query_executor_tasks.rs"],"exampleFix":"// before\nExecutorTask::None => unreachable!(),\n// after\nExecutorTask::None => return Err(ErrorCode::Internal(\"ExecutorTask::None pushed to worker queue\")),","handlingStrategy":"type-guard","validationCode":"if matches!(task, ExecutorTask::None) { return Err(ErrorCode::Internal(\"task is ExecutorTask::None\")); }","typeGuard":"fn is_schedulable(t: &ExecutorTask) -> bool { !matches!(t, ExecutorTask::None) }","tryCatchPattern":null,"preventionTips":["Ensure task producers cannot emit the None sentinel into scheduler queues","Add invariant tests around query_executor_tasks scheduling","Favor Option<Processor> over a None enum variant to make emptiness explicit"],"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"}