fix: preserve CPU headroom during background indexing - #2022
Conversation
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Welcome, and thank you for the PR 👋 — one quick, mechanical thing before review, so you are not left guessing at the red.
The fix is to amend the commit with a sign-off and force-push your branch:
If you end up with more than one commit, Two things that will save you time when the rest of CI reports:
I will review the change itself properly once it is signed off — background-indexing CPU headroom is a good thing to be looking at, and +209/-12 over 8 files is a reviewable size. |
|
Attributed your reds so you are not chasing nine separate things — there are really only two, and one of them is a genuinely interesting test-design point. 1.
|
This comment has been minimized.
This comment has been minimized.
Maintainer notice: please disregard comments from @adfjadfj16-a11y on this thread@adfjadfj16-a11y is not a maintainer of this project and does not speak for it. That account has posted replies on 17 threads here written in the project's voice — promising merges, announcing that a case has been "escalated to the development team", asking to close issues, and in some threads replying as though it were the author of someone else's pull request. None of those were maintainer decisions, and none of them carried any weight. @DeusData is the only account that gives a maintainer response on this repository. If a comment about the fate of your issue or pull request did not come from @DeusData, it is not a decision, however official it reads. If you were waiting on something because of one of those comments — a promised merge, a review "immediately", a request to close your ticket — I am sorry. That was noise you had no way to identify as noise, and it should not have been on your thread. Your issue or PR is judged on its own merits, and I will answer it here myself. Nothing in this notice reflects on your contribution. Thank you for your patience, and thank you for the work. |
What does this PR do?
Carry an internal background-execution marker on the index requests created by both session auto-index and watcher re-index paths, preserving it through daemon coordination and supervised-worker serialization. When
handle_index_repositorybuilds the pipeline, translate that marker into pipeline execution context rather than changing the public MCP tool schema or adding a user-facing configuration key. Make full and incremental pipeline worker-count selection consult that context and use the existing background/incremental default that leaves CPU headroom; retain the currentCBM_WORKERSprecedence, single-thread crash-recovery behavior, and all-core default for explicit/manual indexing.Enabling
auto_indexhas repeatedly caused high CPU usage and severe Windows UI stutter, including a fresh confirmation on v0.10.8. Main already contains the maintainer-identified non-Gitauto_index_limitguard, dirty-state watcher deduplication, and subprocess RSS isolation, so reimplementing those fixes would be a no-op. The remaining production path still treats automatic first indexing like a foreground full index: the pipeline selects theinitial=trueworker policy, whose documented behavior is to use every detected core because “the user is waiting.” Automatic session and watcher jobs run in the background, so they should instead use the repository's existing headroom-preserving worker policy while explicit indexing retains its current throughput.Fixes #1084
Checklist
git commit -s) — required, CI rejectsNot run: no test command resolved in this workspace, so nothing was executed to pass.
unsigned commits (DCO, see CONTRIBUTING.md)
make -f Makefile.cbm test)Not run: no test command resolved in this workspace, so nothing was executed to pass.
make -f Makefile.cbm lint-ci)Not run: no test command resolved in this workspace, so nothing was executed to pass.