{"record":{"id":"016783747156910a","repo":"databendlabs/databend","slug":"used-for-new-executor","errorCode":null,"errorMessage":"used for new executor","messagePattern":"used for new executor","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/query/service/src/pipelines/executor/query_executor_tasks.rs","lineNumber":294,"sourceCode":"\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":276,"sourceCodeEnd":299,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/service/src/pipelines/executor/query_executor_tasks.rs#L276-L299","documentation":"Panic in the legacy `QueryExecutorTasks::push_task` when given an `ExecutorTask::Async(_)` task. This legacy (queries) executor only handles sync and completed-async tasks; async task scheduling is handled exclusively by the new executor, so receiving an Async task here means the wrong executor implementation was selected for the query.","triggerScenarios":"Calling `push_task` on the legacy query executor with an `ExecutorTask::Async` processor, typically when a query/pipeline that requires async scheduling is routed to the old executor path.","commonSituations":"Executor selection misconfiguration (e.g. query settings or feature flag choosing the old executor), or code changes that emit Async tasks without switching to the new executor.","solutions":["Ensure the query uses the new executor (check `flight` / executor settings such as enabling the new async executor) when the pipeline contains async-capable processors","Audit pipeline construction so Async tasks are only produced when the new executor is active","Return a descriptive error instead of `unreachable!()` to make the executor-selection mismatch diagnosable","Compare with `queries_executor_tasks.rs::push_task` which supports the Async variant"],"exampleFix":"// before\nExecutorTask::Async(_) => unreachable!(\"used for new executor\"),\n// after\nExecutorTask::Async(_) => return Err(ErrorCode::Internal(\"Async task requires the new executor\")),","handlingStrategy":"validation","validationCode":"if matches!(task, ExecutorTask::Async(_)) && !use_new_executor { return Err(ErrorCode::Internal(\"async task requires new executor\")); }","typeGuard":"fn supports_async(e: &dyn ExecutorTasks) -> bool { /* true only for QueriesExecutorTasks */ e.handles_async() }","tryCatchPattern":null,"preventionTips":["Route pipelines containing async-capable processors to the new executor","Keep executor selection logic in one place and assert consistency with produced task kinds","Add a test that feeds an Async task to each executor implementation"],"tags":["rust","panic","executor","configuration"],"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"}