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
A daemon keeps the writer lock of a project it opened for one projectPath query #2087
When a session's daemon answers a query with an explicit projectPath for another indexed project, it opens that project in-process and takes its writer lock (.codegraph/writer.pid, fallback mode). The project cache has no idle release, so the lock stays held for as long as that daemon runs. The project's own daemon then can't take the writer role, and codegraph index on it is blocked, until the first daemon exits. Reconnecting MCP servers doesn't help, because the daemon is detached.
Repro: two indexed projects A and B. Start an MCP session in A, call codegraph_explore with projectPath: <B>, then look at B/.codegraph/writer.pid: it names A's daemon and stays that way.
Fix: release a secondary project after an idle timeout (10 min by default, configurable), which frees its writer lock. Happy to open a PR with tests.
One more effect on Windows: while the daemon holds the secondary project open (SQLite handle plus the recursive watcher), the project folder can't be renamed or deleted ("Access to the path is denied"). The idle release in #2093 would bound that to the timeout.
Until it ships, we avoid projectPath for other repos and query them with codegraph explore -p instead, since the CLI exits after each query.
Short data point: we see the same thing as #2087, plus its mirror image - daemon A holding a lease
socket to daemon B counts as a live client of B, so if A and B reference each other neither ever idles
out (src/mcp/project-lifecycle.ts ~111-153, daemon.ts ~505-509). In our fork, leases are released
after 10 idle minutes (env-tunable) and lease connections, marked in the hello, no longer count as live
clients for the inactivity backstop.
Activity
fix(mcp): release an idle explicit project and its writer lock (colby…
vinhch commentedon Oct 1, 2026
One more effect on Windows: while the daemon holds the secondary project open (SQLite handle plus the recursive watcher), the project folder can't be renamed or deleted ("Access to the path is denied"). The idle release in #2093 would bound that to the timeout.
Until it ships, we avoid projectPath for other repos and query them with codegraph explore -p instead, since the CLI exits after each query.
ijbranch commentedon Oct 2, 2026
Short data point: we see the same thing as #2087, plus its mirror image - daemon A holding a lease
socket to daemon B counts as a live client of B, so if A and B reference each other neither ever idles
out (
src/mcp/project-lifecycle.ts~111-153,daemon.ts~505-509). In our fork, leases are releasedafter 10 idle minutes (env-tunable) and lease connections, marked in the hello, no longer count as live
clients for the inactivity backstop.
fix(mcp): release an idle explicit project and its writer lock (#2087) (