Repository navigation
A dead git's index.lock no longer blocks a citizen for days: one owner, continuum-git, for the deploy tree and her hands (card d7765b90) - #5464
Merged
Conversation
joelteply
added a commit
that referenced
this pull request
Oct 26, 2026
…nly the judged lock is unlinked (Codex on #5464) Holder matching: may_work_on (pure) judges a git by every way it can name the tree: cwd inside the work root or the administrative gitdir, --git-dir/--work-tree/-C arguments, or GIT_DIR/GIT_WORK_TREE in its environment, each as given or canonical. A git launched from elsewhere with --git-dir=<a worktree's gitdir> names no work root, and was read as absent. An unreadable cwd is still "may be working here". git_running_in(root, gitdir) reads cmd, cwd and environ. Replacement race: settle records the lock's file identity (continuum_host::file_identity) before the scan and re-reads it before unlinking; a lock re-created in between is another file and is left in place. Tests: a_git_naming_the_tree_any_way_may_hold_its_lock (--git-dir, GIT_DIR, -C, cwd in root, cwd in gitdir, unreadable cwd; another tree's GIT_DIR is not a holder); the worktree fixture pins that a re-created lock reads as another identity. continuum-git now depends on continuum-host, so a host change selects it (selector test updated, passes). Not built locally: no cargo on enrico during the #5462 receipt window; CI compiles and tests it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
added a commit
that referenced
this pull request
Oct 26, 2026
…m; the judged lock stays open until the unlink (Codex on #5464) may_work_on resolves path-valued options against the cwd after each ordered -C (=value and separate forms) and GIT_DIR/GIT_WORK_TREE against both the process cwd and the final -C directory, normalizing . and .. lexically. Regressions: relative --git-dir (both forms), relative GIT_DIR, -C then relative --git-dir, ordered -C into the root, a .. path, and a relative path naming another tree (not a holder). settle keeps the judged lock's handle open through revalidation and the unlink, so its identity cannot be reused by a re-created file. The test now holds the handle rather than assuming a fresh inode. The doc states the remaining window: a replacement landing between the last identity read and the unlink would be removed (portable code cannot unlink by handle). Not built locally (no cargo on enrico during the #5462 receipt window); CI compiles it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
added a commit
that referenced
this pull request
Oct 26, 2026
… ALL -C options, as git does (Codex on #5464) Regression: git --git-dir=.git/worktrees/tree -C /repo status from /elsewhere names /repo/.git/worktrees/tree. The directory where the option sits is kept too, conservatively. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
added a commit
that referenced
this pull request
Oct 26, 2026
…on, and no age claim on the zero-bound path (Codex on #5464) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
added a commit
that referenced
this pull request
Oct 26, 2026
…nly the judged lock is unlinked (Codex on #5464) Holder matching: may_work_on (pure) judges a git by every way it can name the tree: cwd inside the work root or the administrative gitdir, --git-dir/--work-tree/-C arguments, or GIT_DIR/GIT_WORK_TREE in its environment, each as given or canonical. A git launched from elsewhere with --git-dir=<a worktree's gitdir> names no work root, and was read as absent. An unreadable cwd is still "may be working here". git_running_in(root, gitdir) reads cmd, cwd and environ. Replacement race: settle records the lock's file identity (continuum_host::file_identity) before the scan and re-reads it before unlinking; a lock re-created in between is another file and is left in place. Tests: a_git_naming_the_tree_any_way_may_hold_its_lock (--git-dir, GIT_DIR, -C, cwd in root, cwd in gitdir, unreadable cwd; another tree's GIT_DIR is not a holder); the worktree fixture pins that a re-created lock reads as another identity. continuum-git now depends on continuum-host, so a host change selects it (selector test updated, passes). Not built locally: no cargo on enrico during the #5462 receipt window; CI compiles and tests it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
force-pushed
the
d7765b90/git-lock
branch
from
October 26, 2026 13:28
88d29be to
8db34a8
Compare
joelteply
added a commit
that referenced
this pull request
Oct 26, 2026
…m; the judged lock stays open until the unlink (Codex on #5464) may_work_on resolves path-valued options against the cwd after each ordered -C (=value and separate forms) and GIT_DIR/GIT_WORK_TREE against both the process cwd and the final -C directory, normalizing . and .. lexically. Regressions: relative --git-dir (both forms), relative GIT_DIR, -C then relative --git-dir, ordered -C into the root, a .. path, and a relative path naming another tree (not a holder). settle keeps the judged lock's handle open through revalidation and the unlink, so its identity cannot be reused by a re-created file. The test now holds the handle rather than assuming a fresh inode. The doc states the remaining window: a replacement landing between the last identity read and the unlink would be removed (portable code cannot unlink by handle). Not built locally (no cargo on enrico during the #5462 receipt window); CI compiles it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
added a commit
that referenced
this pull request
Oct 26, 2026
… ALL -C options, as git does (Codex on #5464) Regression: git --git-dir=.git/worktrees/tree -C /repo status from /elsewhere names /repo/.git/worktrees/tree. The directory where the option sits is kept too, conservatively. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
added a commit
that referenced
this pull request
Oct 26, 2026
…on, and no age claim on the zero-bound path (Codex on #5464) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…r, continuum-git, for the deploy tree and her hands (card d7765b90)
On enrico (2026-10-26) 6 residents' workspaces held .git/index.lock dated 10-14..16, empty, held
by no process. Every git write failed ("Unable to create .../index.lock: File exists") for
~10 days until Eitan reported it; I removed them by hand. The deploy consumer had the same
failure on the M5 (card 677437fa) and solved it for its own tree only.
The likely source is our own deadline: run_git_input's owner kills a git that outlives its
deadline (Why::TimedOut), and a killed git leaves its lock.
continuum-git::index_lock is now the one owner (moved, not copied):
- the verdict (stale only when older than the caller's bound AND no git might work in the tree);
- the conservative live-git scan (moved from bin/continuum deploy_ledger);
- a lock locator that needs no git process (clone or worktree .git file);
- settle(), which judges and removes.
Users:
- the deploy consumer's settle_index_lock is a thin mapping of settle() onto its notes; the
verdict, enum, bound and test leave cli-lifecycle's deploy_tracker;
- a citizen's git (git_bridge::run_git_input) settles before every git with the 10-min bound,
and with a zero bound right after it ends a git on its deadline (that lock is that git's
unless another git now works in the tree). The scan runs in spawn_blocking and only when a
lock exists, and each outcome is probed (hands.git.index_lock_{held,cleared,unremovable}).
The new crate is in all four lists (TESTED_CRATES with no fixtures feature, the crate-test
allowlist, MODULE_CRATES via its index_lock.rs module, the warnings count). The selector test
names the floor (base, host, git) once and pins a git change's scope.
Local (IntelMac, before stopping builds here): continuum-git 2/2; selector tests pass.
cli-lifecycle 83/84, one failure in installed_release (untouched by this change, judged by CI).
hands and core compile and test in CI: local builds were stopped on this CPU-serving node
after they coincided with serving.throughput.degraded.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…nly the judged lock is unlinked (Codex on #5464) Holder matching: may_work_on (pure) judges a git by every way it can name the tree: cwd inside the work root or the administrative gitdir, --git-dir/--work-tree/-C arguments, or GIT_DIR/GIT_WORK_TREE in its environment, each as given or canonical. A git launched from elsewhere with --git-dir=<a worktree's gitdir> names no work root, and was read as absent. An unreadable cwd is still "may be working here". git_running_in(root, gitdir) reads cmd, cwd and environ. Replacement race: settle records the lock's file identity (continuum_host::file_identity) before the scan and re-reads it before unlinking; a lock re-created in between is another file and is left in place. Tests: a_git_naming_the_tree_any_way_may_hold_its_lock (--git-dir, GIT_DIR, -C, cwd in root, cwd in gitdir, unreadable cwd; another tree's GIT_DIR is not a holder); the worktree fixture pins that a re-created lock reads as another identity. continuum-git now depends on continuum-host, so a host change selects it (selector test updated, passes). Not built locally: no cargo on enrico during the #5462 receipt window; CI compiles and tests it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…m; the judged lock stays open until the unlink (Codex on #5464) may_work_on resolves path-valued options against the cwd after each ordered -C (=value and separate forms) and GIT_DIR/GIT_WORK_TREE against both the process cwd and the final -C directory, normalizing . and .. lexically. Regressions: relative --git-dir (both forms), relative GIT_DIR, -C then relative --git-dir, ordered -C into the root, a .. path, and a relative path naming another tree (not a holder). settle keeps the judged lock's handle open through revalidation and the unlink, so its identity cannot be reused by a re-created file. The test now holds the handle rather than assuming a fresh inode. The doc states the remaining window: a replacement landing between the last identity read and the unlink would be removed (portable code cannot unlink by handle). Not built locally (no cargo on enrico during the #5462 receipt window); CI compiles it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
… ALL -C options, as git does (Codex on #5464) Regression: git --git-dir=.git/worktrees/tree -C /repo status from /elsewhere names /repo/.git/worktrees/tree. The directory where the option sits is kept too, conservatively. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…on, and no age claim on the zero-bound path (Codex on #5464) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
force-pushed
the
d7765b90/git-lock
branch
from
October 26, 2026 14:16
8db34a8 to
6410759
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Serves the "Useful" step: a resident can't land a PR while her git is locked. On enrico, six of them couldn't commit at all for about ten days.
The incident (enrico, 2026-10-26)
Six residents' workspaces (4c9bb8d9, cf6b4df6/Eitan, 0d5c1ffa, b6dcfc8e, 0051cdcf, 18c04c5b) each had a
.git/index.lock:lsofempty).Every git write failed with
Unable to create '…/index.lock': File existsuntil Eitan reported it. I removed all six by hand after checking that no process held them. The deploy consumer hit the same failure on the M5 (card 677437fa) and had solved it for its own tree only.Likely source (hypothesis, not proven): our own deadline.
git_bridge::run_git_inputhands git torun_owned_with_input, which kills a git that outlives its deadline (Why::TimedOut), and a killed git leaves its lock.One owner:
continuum-git::index_lock(moved, not copied)verdict(age, stale_after, git_in_tree): stale only when older than the caller's bound and no git might be working in the tree.git_running_in(root): the conservative scan, moved frombin/continuum/deploy_ledger.rs. An unreadable cwd counts as "may be working here".lock_path(root): finds the lock in a clone or in a worktree's.gitfile, without spawning git.settle(root, stale_after): judges and removes. The process scan runs only when a lock exists, so a clean tree costs onestat.Users
settle_index_locknow just mapssettle()onto its existing notes. The verdict, enum, bound and test leavecli-lifecycle::deploy_tracker.run_git_inputsettles before every git call, with the 10-minute bound. Right after it ends a git on its own deadline, it settles with a zero bound: that lock belongs to the git we just ended, unless another git now works in the tree. The scan runs inspawn_blocking. Every outcome is probed:hands.git.index_lock_{held,cleared,unremovable,unjudged}.Wiring
continuum-gitis in all four lists:TESTED_CRATES, asNO_FIXTURES;MODULE_CRATES, through itsindex_lock.rsmodule;The selector tests name the floor crates (base, host, git) once and pin the scope of a git change.
Measured
continuum-git2/2: the verdict table, plus clone and worktree locks found and cleared;cli-lifecycle83/84, the one failure ininstalled_release, which this change doesn't touch.serving.throughput.degraded; enrico serves on the CPU.hands.git.index_lock_cleared, with ages and stale bounds;Unable to create … index.lockin residents' git results;🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE