zed-industries/zed · error
temporary repository barrier canceled
Error message
temporary repository barrier canceled
What it means
While setting up the temporary repository for worktree archival/restore, awaiting repo.barrier() was cancelled (future dropped), meaning the git barrier that serializes repository access did not complete.
Solutions
- Retry the operation once the temporary project's repository finishes replaying its git events and the barrier resolves
- Ensure the temporary project (and its Repository entity) is not dropped or torn down while the barrier is pending
- If cancellation is expected during shutdown, propagate it as a clean abort rather than surfacing it as a failure
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at crates/agent_ui/src/thread_worktree_archive.rs:469 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/8055c74701b7ea06.
Report an issue: GitHub.
Appendix: source
Thrown at crates/agent_ui/src/thread_worktree_archive.rs:469
let repo_path_for_find = repo_path.to_path_buf();
let repo = temp_project
.update(cx, |project, cx| {
project
.repositories(cx)
.values()
.find(|repo| {
repo.read(cx).snapshot().work_directory_abs_path.as_ref()
== repo_path_for_find.as_path()
})
.cloned()
})
.context("failed to resolve temporary repository handle")?;
let barrier = repo.update(cx, |repo: &mut Repository, _cx| repo.barrier());
barrier
.await
.map_err(|_| anyhow!("temporary repository barrier canceled"))?;
Ok((repo, temp_project))
}
/// Re-adds the worktree to every affected project after a failed
/// [`remove_root`].
async fn rollback_root(root: &RootPlan, cx: &mut AsyncApp) {
for affected in &root.affected_projects {
let task = affected.project.update(cx, |project, cx| {
project.create_worktree(root.root_path.clone(), true, cx)
});
task.await.log_err();
}
}
/// Saves the worktree's full git state so it can be restored later.
///
/// This creates two detached commits (via [`create_archive_checkpoint`] on
/// the `GitRepository` trait) that capture the staged and unstaged stateView on GitHub (pinned to f4178619ac)