Repository navigation
fix(lock): a live writer keeps its lock regardless of age (#1959) - #1978
Closed
danusha2345 wants to merge 1 commit into
Closed
danusha2345 wants to merge 1 commit into
danusha2345 wants to merge 1 commit into
Conversation
Owner
|
Thanks @danusha2345! Your commits here were carried into #2043 (authorship preserved), with a few follow-up changes from review, and that is now merged. Closing this one in favour of it. It will be in the next release. |
This was referenced Sep 27, 2026
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.
Addresses ask 6 of #1959.
Problem
FileLocktreated any lock older than two minutes as stale "regardless of PID status", and a live holder never refreshes the lock file. A sync that runs past two minutes is joined by the next one, and the two write the same rows at once. The report in #1959 has one sync running 75 minutes while newer syncs deleted the rows it kept adding.Fix
The age test is gone: a lock is stale only when its PID is dead or unparseable. A holder that crashes still frees the lock, because its PID is dead.
codegraph unlockstays the manual escape hatch the error message already names.Tests
security.test.ts: a lock file backdated three minutes, holding a live PID, is still refused. Full suite on this branch (Linux, Node 22, native kernel): all tests pass except the knownextraction.test.tspool-worker crash from #1779 (fixed by #1883), which is intermittent and also occurs onmain; that file alone passes 655/655.🤖 Generated with Claude Code