Repository navigation
perf(query): retire excess workers after idle bursts - #2862
Open
doomsday1906 wants to merge 1 commit into
Open
doomsday1906 wants to merge 1 commit into
doomsday1906 wants to merge 1 commit into
Conversation
doomsday1906
marked this pull request as ready for review
October 23, 2026 21:04
This branch has not been deployed
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.
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.