You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ae2bed1
Browse filesBrowse the repository at this point in the historyBrowse files
fix(storage): wait out a busy graph DB instead of discarding it (#27)
* fix(storage): wait out a busy graph DB instead of discarding it
A session that started while another process had graph.db open (any
sibling session or daemon mid-load or mid-persist) treated the lock
error as corruption: it set the healthy DB aside as graph.db.corrupt and
redirected every project to a fresh, empty generation. On Linux the
stale-LOCK cleanup could also delete a live holder's LOCK file, because
its flock probe cannot see RocksDB's fcntl lock, letting two processes
open the same DB.
- RocksDBBackend::open reports lock contention as GraphError::Locked.
- open_waiting_for_lock replaces open_with_stale_lock_recovery: it
retries with backoff for a bounded time and never removes LOCK. The OS
drops a lock when its holder exits, so a leftover LOCK file never
blocked an open; removing one only ever risked a second writer. fs2 is
no longer needed.
- Every open of the shared DB goes through memory::open_shared_graph_db
(10s wait), including vector claim/save/load and cross-project impact.
- open_persistent_graph redirects only on a real load failure, never on
Locked.
- Saved file hashes are ignored when the project's graph loads empty.
After any redirect they made the indexer skip every unchanged file,
leaving the project with no symbols until a file changed.
Verified end to end with the release binary (live holder for 4s and
20s, SIGKILLed holder, damaged CURRENT) and by new crate and
integration tests on macOS, SLES 15-SP4 and Windows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017rVbt7rENTwXkdHt3Bpgb5
* no-mistakes(review): Disarm load sentinel during lock waits; share cross-project handle
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments