Repository navigation
Give each vendor probe a dedicated thread - #912
Merged
Merged
Conversation
The pool is not told about a WaitForExit or event wait, so a saturated pool grows by about one thread a second and queued probes serialize. The test saturates it with the same silent kind of wait: a Task.Wait on a pool thread is compensated with a new thread and would prove nothing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PR Summary by QodoRun vendor probes on dedicated long-running threads
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can switch off images and animations for a plain-text comment |
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.
Closes #911 — AI-2729
What & why
ProbeVendorsConcurrentlyran each vendor probe onTask.Run. A probe blocks its thread inWaitForExitfor up to its whole budget, and the pool is not told about that kind of block, so once the pool is saturated the queued probes start about one thread a second and the pass serializes — the flaky assertion was observing exactly that under full-suite load. Each probe now runs on its own long-running thread, which holds the overlap regardless of pool state. The two timing tests become a rendezvous that cannot pass sequentially and a gate that cannot finish before the ceiling.Where to look
The saturation test blocks pool threads with
ManualResetEventSlim.Wait, notTask.Wait: aTask.Waiton a pool thread is compensated with a new thread, and with it the test passed against the unfixed code. The assertion quoted in the issue belongs to the sibling…OverlapsProbes…test; both tests share this cause.Verification
Repro with a saturated pool (12 cores, 16 blocked threads):
Task.RungavemaxConcurrent=1over 4.3s andfast2=TIMEOUT;LongRunninggavemaxConcurrent=5in 303ms andfast2=fast2-v.ProbeVendorsConcurrently_OverlapsProbes_EvenWhenThreadPoolIsSaturatedfails before the fix (every probe times out at the 2s ceiling) and passes after; the class passes 5/5 repeated runs. FullCapacitor.Cli.Daemon.Tests.Unit: 3233 total, 3193 passed, 2 failed, both pre-existing (AcpMetricsTestsshared-meter race, passes in isolation; codex schema pin vs locally installed codex 0.151.0).dotnet publish -c Releaseof the daemon: 0 IL warnings.