{"record":{"id":"65d138e0b6ad6c3c","repo":"zed-industries/zed","slug":"commit-data-reader-task-closed","errorCode":null,"errorMessage":"commit data reader task closed","messagePattern":"commit data reader task closed","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/git/src/repository.rs","lineNumber":151,"sourceCode":"}\n\nstruct CommitDataRequest {\n    sha: Oid,\n    response_tx: oneshot::Sender<Result<CommitData>>,\n}\n\npub struct CommitDataReader {\n    request_tx: async_channel::Sender<CommitDataRequest>,\n    _task: Task<()>,\n}\n\nimpl CommitDataReader {\n    pub async fn read(&self, sha: Oid) -> Result<CommitData> {\n        let (response_tx, response_rx) = oneshot::channel();\n        self.request_tx\n            .send(CommitDataRequest { sha, response_tx })\n            .await\n            .map_err(|_| anyhow!(\"commit data reader task closed\"))?;\n        response_rx\n            .await\n            .map_err(|_| anyhow!(\"commit data reader task dropped response\"))?\n    }\n\n    #[cfg(any(test, feature = \"test-support\"))]\n    pub fn for_test(\n        executor: BackgroundExecutor,\n        resolve: impl 'static + Send + Sync + Fn(Oid) -> Result<CommitData>,\n    ) -> Self {\n        let (request_tx, request_rx) = smol::channel::bounded::<CommitDataRequest>(64);\n        let resolve = Arc::new(resolve);\n        let delay_executor = executor.clone();\n        let task = executor.spawn(async move {\n            while let Ok(CommitDataRequest { sha, response_tx }) = request_rx.recv().await {\n                delay_executor.simulate_random_delay().await;\n                response_tx.send(resolve(sha)).ok();\n            }","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/git/src/repository.rs#L133-L169","documentation":"CommitDataReader::read could not send its request: the async_channel sender to the background commit-reading task is closed, meaning the reader task has shut down (dropped, panicked, or the repository was disposed). This sentinel reports that commit data can never be served because the servicing task is gone — not that the commit itself is missing.","triggerScenarios":"Thrown at crates/git/src/repository.rs:151 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat the reader as permanently down: fail the commit-data lookup and let callers degrade gracefully (e.g. hide commit details)","Log the shutdown reason — a panicked reader task should be surfaced, not silently swallowed","Recreate the reader task when the repository is re-opened"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5a9b9558db01a6b906cec2fb70a797affdc58cdd","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}