zed-industries/zed · error · anyhow::Error

commit data reader task closed

Error message

commit data reader task closed

What it means

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.

Source

Thrown at crates/git/src/repository.rs:151

}

struct CommitDataRequest {
    sha: Oid,
    response_tx: oneshot::Sender<Result<CommitData>>,
}

pub struct CommitDataReader {
    request_tx: async_channel::Sender<CommitDataRequest>,
    _task: Task<()>,
}

impl CommitDataReader {
    pub async fn read(&self, sha: Oid) -> Result<CommitData> {
        let (response_tx, response_rx) = oneshot::channel();
        self.request_tx
            .send(CommitDataRequest { sha, response_tx })
            .await
            .map_err(|_| anyhow!("commit data reader task closed"))?;
        response_rx
            .await
            .map_err(|_| anyhow!("commit data reader task dropped response"))?
    }

    #[cfg(any(test, feature = "test-support"))]
    pub fn for_test(
        executor: BackgroundExecutor,
        resolve: impl 'static + Send + Sync + Fn(Oid) -> Result<CommitData>,
    ) -> Self {
        let (request_tx, request_rx) = smol::channel::bounded::<CommitDataRequest>(64);
        let resolve = Arc::new(resolve);
        let delay_executor = executor.clone();
        let task = executor.spawn(async move {
            while let Ok(CommitDataRequest { sha, response_tx }) = request_rx.recv().await {
                delay_executor.simulate_random_delay().await;
                response_tx.send(resolve(sha)).ok();
            }

View on GitHub (pinned to 5a9b9558db)

Solutions

  1. Treat the reader as permanently down: fail the commit-data lookup and let callers degrade gracefully (e.g. hide commit details)
  2. Log the shutdown reason — a panicked reader task should be surfaced, not silently swallowed
  3. Recreate the reader task when the repository is re-opened
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/git/src/repository.rs:151 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@5a9b9558db (2026-08-20). Data as JSON: /api/errors/65d138e0b6ad6c3c. Report an issue: GitHub.