Keep killed git processes from leaving locks that block self-updates - #37
Merged
Merged
Conversation
…dates, and clear stale ones Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… deleting, bound every kill wait, and ledger each clear Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Summary
Since 11:53 today, every self-update failed with
Unable to create '.git/index.lock': File exists, so #36 never went live.Where the lock came from. The pulse log shows
build-ws-context workspace:281 rc=124: timeout after 30sat 11:53:02.747, the same second as the lock's mtime. The pulse'srun()SIGKILLed build-ws-context's process group while itsgit status --porcelainheld.git/index.lock, which git takes to refresh the index. A SIGKILL can't be caught, so the lock stayed. Seven repos on this machine hold such locks. Four of them match a pulsebuild-ws-contexttimeout to the second (2026-09-01, 09-10, 09-11, 09-28).What changes
git statusandgit logcalls pass--no-optional-locks, so they never take the index lock. Self-update's_gitdoes the same.<git-dir>/index.lockif the lock is older than 10 minutes,lsofshows no process has it open, and no git process is working in the repo.git commit -acloses the lock file but keeps the lock while hooks and the editor run..gitignorenow covers.claude/worktrees/(Claude Code's agent worktrees) and.claude/.assistant/.Deploying this
The live checkout can't pull this until its current lock is gone. The fix can't clear it, because it's blocked by the same lock.
~/dev/assistant/.git/index.lockhas to be removed once by hand.Validation
--no-optional-locks(the index gets rewritten)pull-failed)Known limits
index.lockis cleared. A staleHEAD.lockor ref lock still fails loudly aspull-failed.🤖 Generated with Claude Code