Skip to content

fix(deploy): the consumer clears a deploy tree's stale index.lock with a receipt, and names a live one without spending an attempt (card 677437fa) - #4477

Merged
joelteply merged 4 commits into
canaryfrom
fix/deploy-tree-stale-index-lock
Sep 27, 2026
Merged

joelteply merged 4 commits into
canaryfrom
fix/deploy-tree-stale-index-lock

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

A git that died mid-write left .git/index.lock in the M5's deploy tree, and
every consumer tick's checkout failed on it: 41 refusals over ~3.4 h, then again
17:27-19:3xZ on 2026-09-27, each time cleared by hand. Each failure also counted
against the tip's CONSUME_MAX_ATTEMPTS, so a stale lock could strand a tip.

Before the deploy attempt, the consumer now judges the lock (found with
git rev-parse --git-path index.lock, so worktrees resolve too):

  • none: deploy;
  • older than STALE_INDEX_LOCK (10 min, far past any git write) with no git
    process whose cwd is inside the tree (sysinfo): remove it, with the receipt
    deploy.tree.stale_lock_cleared {path, age}, and deploy;
  • younger, or a git process stands in the tree: name it (path and age) in the
    deploy log and try next tick, without spending one of the tip's attempts.

index_lock_verdict is pure and pinned by a test.

Co-Authored-By: Claude Opus 5.5 [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…h a receipt, and names a live one without spending an attempt (card 677437fa)

A git that died mid-write left .git/index.lock in the M5's deploy tree, and
every consumer tick's checkout failed on it: 41 refusals over ~3.4 h, then again
17:27-19:3xZ on 2026-09-27, each time cleared by hand. Each failure also counted
against the tip's CONSUME_MAX_ATTEMPTS, so a stale lock could strand a tip.

Before the deploy attempt, the consumer now judges the lock (found with
`git rev-parse --git-path index.lock`, so worktrees resolve too):
- none: deploy;
- older than STALE_INDEX_LOCK (10 min, far past any git write) with no git
  process whose cwd is inside the tree (sysinfo): remove it, with the receipt
  deploy.tree.stale_lock_cleared {path, age}, and deploy;
- younger, or a git process stands in the tree: name it (path and age) in the
  deploy log and try next tick, without spending one of the tip's attempts.

index_lock_verdict is pure and pinned by a test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply and others added 3 commits September 27, 2026 14:40
…m elsewhere, holds the lock (Codex on #4477)

git_running_in ruled out any git whose cwd sat outside the tree, including
`git -C <repo>` (its cwd stays elsewhere while it owns the tree's index) and a
process whose cwd could not be read. Now only a git positively seen working
elsewhere is ruled out: an unreadable cwd, a cwd in the tree, or a command line
naming the tree (as given or canonical) all keep the lock Held.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…cker, so CI's lib-test job runs its test (Codex on #4478/#4477)

Tests in bin/continuum.rs are compiled by CI's windows `--tests` check but never
run: the only test job is `cargo test -p continuum-core --lib`. The pure
verdict (STALE_INDEX_LOCK, IndexLock, index_lock_verdict) moves beside the
tracker's other deploy verdicts, with its test in that file's existing tests
mod. The consumer keeps the effectful half (git rev-parse, the sysinfo git
check, the removal and its receipt).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Fable: APPROVED at abb9f01, 8/8 green. A lock is cleared only when it is 10 min old and no git process has its cwd in the tree; a git whose cwd cannot be read keeps it Held; a lock that may be live is named and waited on without spending the tip's attempts. The pure verdict and its test now run in the lib job.

@joelteply
joelteply merged commit d1dd4fa into canary Sep 27, 2026
8 checks passed
@joelteply
joelteply deleted the fix/deploy-tree-stale-index-lock branch September 27, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant