fix(mcp): serialize ADR access across processes#892
Open
SS-42 wants to merge 1 commit into
Open
Conversation
5ae3a19 to
42b1878
Compare
Use a cache-local advisory lock so independent MCP and CLI processes sharing CBM_CACHE_DIR cannot rebuild the same project DB concurrently. Serialize manage_adr reads and writes with rebuilds, reopen stale file-backed stores before ADR access, and cover the cross-process lock behavior with fork-based regression tests. Signed-off-by: SS-42 <noreply@incogni.to>
42b1878 to
c52e266
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 rebuilds, and reopen stale file-backed stores before ADR accessEnvironment observed
CBM_CACHE_DIRRepro covered by tests
try_lockreport busymanage_adr(update)cannot write while another process owns the rebuild lockVerification
git diff --check./build/c/test-runner pipeline(218 passed)./build/c/test-runner mcp(141 passed)scripts/build.sh --version 0.8.1-adrfix.20260705d CC=clang CXX=clang++