Skip to content

perf(query): retire excess workers after idle bursts - #2862

Open
doomsday1906 wants to merge 1 commit into
colbymchenry:mainfrom
doomsday1906:upstream/query-worker-idle-W9cb1df
Open

doomsday1906 wants to merge 1 commit into
colbymchenry:mainfrom
doomsday1906:upstream/query-worker-idle-W9cb1df

Conversation

@doomsday1906

@doomsday1906 doomsday1906 commented Oct 23, 2026 •

Copy link
Copy Markdown

A session grows its query pool for concurrent reads but retains every worker's heap and SQLite connection until shutdown. After a burst, an otherwise idle MCP server therefore keeps paying for the peak worker count.

Retire excess workers after 60 seconds idle, retain one warm worker, and regrow through the existing dispatch path. Active/starting workers are preserved, intentional retirement does not consume the crash budget, and shutdown awaits retirements already underway. No new public setting or dependency.

Validation on Linux/WSL, based on main 44adef8: all 28 query-pool tests passed, including real compiled workers, multi-project dispatch, failed-open recovery and teardown. The three added regressions cover repeated shrink/regrow, busy/starting workers, and shutdown during retirement. An installed MCP comparison on the maintained fork previously dropped idle RSS from about 673 MiB to 426 MiB while preserving source queries.

Windows x64 and macOS arm64 native builds and focused regressions also passed (39 tests on each platform, including the native scaffold). Cross-platform validation checks the exact PR head commit. This PR excludes the maintained-fork installer, runtime identity and workstation configuration.

@doomsday1906
doomsday1906 marked this pull request as ready for review October 23, 2026 21:04
@doomsday1906 doomsday1906 changed the title Release excess query workers after idle bursts perf(query): retire excess workers after idle bursts Oct 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant