Repository navigation
Fix starvation flake in ArteryShutdownSystemMessageAckRaceSpec - #8360
Merged
Aaronontheweb merged 2 commits intoJul 11, 2026
Merged
Aaronontheweb merged 2 commits into
Aaronontheweb merged 2 commits into
Conversation
The spec raced the StreamSupervisor's shutdown window with 8 never-yielding busy-spin Task.Run workers (up to 100k iterations each). On 2-core CI agents those workers starved the shared ThreadPool badly enough that the supervisor's own mailbox processing fell behind the test's 10s Terminated bound -- and the workers' only exit flag was set after that very expectation, so the starvation fed itself. An environment-timing flake, not a product regression. Rewritten as a coarse smoke test of the guard's observable contract: race a real full ActorSystem.Terminate() (exercising both the IsTerminating window and the _isShutdown fast-path) against a small bounded yielding burst of EnqueueControl calls, and assert zero ERROR logs across the whole shutdown. The burst may not land in the terminating window on every run; that trade-off is accepted and documented in the spec remarks. No product-code changes.
Aaronontheweb
force-pushed
the
fix/artery-shutdown-spec-starvation
branch
from
July 10, 2026 20:45
0396e17 to
e119366
Compare
Member
Author
|
Reworked per review feedback: dropped the deterministic-gate apparatus (cell surgery, blocking-PostStop gate child, product-code observability hook) in favor of asserting the guard's observable contract — zero ERROR logs while a bounded yielding burst races a real system termination. Now touches only the spec file; net -21 lines vs dev. Same verification matrix: 3x unconstrained + 10x under taskset -c 0,1, all green. |
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.
Fixes the Windows CI flake that hit #8358's PR validation (
ArteryShutdownSystemMessageAckRaceSpectiming out after 10s waiting forTerminated).Root cause, established by a two-pass concurrency analysis: the spec raced the StreamSupervisor's shutdown window with 8 never-yielding busy-spin workers on the shared .NET ThreadPool — the same pool the supervisor, its children, and the test probe all need. On a 2-core CI agent the workers starve the supervisor's own mailbox processing, and the workers' only exit flag was set after the
ExpectMsgAsync<Terminated>they were starving. Many-core Linux boxes hide it with spare cores, which is why it only bites hosted Windows agents. It's an environment-timing flake in the spec, not a product race — supervisor termination itself was verified monotonic and safe.The rewrite asserts the guard's observable contract and nothing else: a bounded, yielding burst of fresh control-stream materialization attempts races a real
system.Terminate(), and the spec asserts zero ERROR logs across the window, with the termination task itself as the completion signal. All the internal-teardown observation (watching the supervisor, hard 10sTerminatedexpectation) is gone, along with the busy-spin workers. This is deliberately a coarse smoke test — the terminating window may not be hit on every single run — which is the right cost/benefit for a guard whose failure mode is log noise; the spec's remarks say so explicitly.Touches only the one spec file. Verification: 3x unconstrained and 10x under
taskset -c 0,1(2-core emulation) all green; full Artery suite 193/193; zero warnings.