fix(mcp): serialize ADR access across processes#892
Open
SS-42 wants to merge 1 commit into
Open
Conversation
42b1878 to
c52e266
Compare
Use project-scoped cache-local advisory locks so independent MCP and CLI processes sharing CBM_CACHE_DIR cannot rebuild the same project DB concurrently without blocking unrelated project indexes. Serialize manage_adr reads and writes with same-project rebuilds, reopen stale file-backed stores before ADR access, and avoid watcher self-locking when a supervised worker performs the reindex. Cover the cross-process lock behavior with fork-based regression tests. Signed-off-by: SS-42 <noreply@incogni.to>
c52e266 to
ba39ffd
Compare
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
CBM_CACHE_DIRmanage_adrreads, writes, and legacy migration with same-project rebuilds, and reopen stale file-backed stores before ADR accessEnvironment observed
CBM_CACHE_DIRRepro covered by tests
try_lockreport busy for the same projectmanage_adr(update)cannot write while another process owns the same-project rebuild lockVerification
git diff --checkASAN_OPTIONS=detect_leaks=0 build/c/test-runner pipeline mcp(360 passed)scripts/test.sh CC=clang CXX=clang++(5920 passed, 1 skipped; watchdog regressions passed; security allow-list passed)scripts/build.sh --version 0.8.1-adrfix.20260706a CC=clang CXX=clang++