Repository navigation
fix(mcp): release an idle explicit project and its writer lock (#2087) - #2283
Merged
Merged
Conversation
A daemon that answered a `projectPath` query for another indexed project opened it in-process and, with no owner there, took its writer lock. The project cache only evicted over its LRU bound or on shutdown, so the lock stayed held for the daemon's whole life: the project's own daemon could not become its writer and `codegraph index` there was refused. Release a cached explicit project once it has gone unused for 10 minutes (CODEGRAPH_PROJECT_IDLE_TIMEOUT_MS; 0 never releases), through the same trim path as LRU eviction, so an active call or a running catch-up still defers it. The next call reopens the project and catches it up (#1835). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 092d49d)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 2, 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.
Carries #2093 by @danusha2345 onto current
main. The commit keeps its author; the only addition is a changelog credit.Closes #2087.
What was wrong
When a session's daemon answered a
codegraph_explorecall with an explicitprojectPathfor another indexed project, it opened that project in-process and took its writer lock. The project cache had no idle release, so the daemon kept the lock for as long as it ran. That project's own daemon then couldn't become the writer, andcodegraph indexthere was blocked. On Windows, the open handle and watcher also stopped the folder from being renamed or deleted.Fix
projectPathis released after it goes unused forCODEGRAPH_PROJECT_IDLE_TIMEOUT_MS(10 minutes by default;0never releases it).Verification
mcp-projectpath-lifecycle,concurrent-lockingandroot-identity: 44 tests pass on currentmain. They include the two new cases: an idle project releases and later retakes its writer lock, and a release waits for an active catch-up.🤖 Generated with Claude Code