feat: lock-file identity, bounded-wait acquisition, and Busy diagnostics#25
Merged
murari316 merged 8 commits intoJul 22, 2026
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> # Conflicts: # crates/infigraph-core/src/lib.rs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…doption Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… Busy on expiry) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rnel-flock throughput Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pradeepmouli
requested review from
johnintuit,
murari316 and
sandeep-mewara
as code owners
July 20, 2026 23:36
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
murari316
approved these changes
Jul 22, 2026
murari316
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed diff in full — lockfile.rs is well-structured (flock as liveness truth, identity payload for diagnostics only, bounded-wait exponential backoff, Busy error naming holder). 12 new tests cover identity roundtrip, stale-payload adoption, timeout naming, and old-binary compatibility. Approving.
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.
What
infigraph-core::lockfilemodule: JSON identity payload (pid/role/build_hash/acquired_at) stamped into held lock files; bounded-wait acquisition with 1ms→500ms exponential backoff; a structuredBusyerror naming the current holder; conservative stale handling — the kernel flock is the liveness truth (a free flock with a leftover payload is adopted; a held flock with an unreadable payload is an unknown holder and is never broken).WriteLock(the graph write lock at<db>.lock) now delegates to it. Public API unchanged; behavioral change:write_lock()waits up to 30s and then errors with a downcastableBusyinstead of blocking forever. NewGraphStore::write_lock_with_timeoutfor caller-chosen budgets.build.rs→INFIGRAPH_BUILD_HASH, git-dir-aware rerun tracking) so a stale-binary lock holder is identifiable from the lock file alone.Why
Today the graph write lock is a 0-byte flock: a wedged or orphaned holder hangs every other process silently and undiagnosably. This makes contention observable (who holds it, since when, built from what) and bounded (structured timeout errors instead of infinite blocks). It is groundwork for follow-up PRs adding an operation-scoped index lock and shared-state (sessions/registry) locking.
Compatibility
write_lock{,_edge_cases,_wiring,_perf}suites pass unmodified.Testing
infigraph-coresuite green: 29 suites, 589 passed, 0 failed.🤖 Generated with Claude Code
https://claude.ai/code/session_01GhPBkDMHPpgcYJ3TKLAC1r