Fix race in shared-stream overflow test that could hang the suite#68652
Closed
potiuk wants to merge 1 commit into
Closed
Fix race in shared-stream overflow test that could hang the suite#68652potiuk wants to merge 1 commit into
potiuk wants to merge 1 commit into
Conversation
test_ack_mode_queue_full_during_fanout_does_not_break_iteration pre-fills a subscriber queue with a sentinel and expects the background poll task to hit QueueFull and overflow-fail that subscriber at fan-out. The test then started draining the subscriber immediately, so depending on event-loop scheduling the drain could consume the sentinel first — leaving the queue no longer full when the burst was fanned out, so no overflow occurred and the iteration blocked forever (surfacing as a TimeoutError under load, e.g. the LowestDeps canary). Synchronise on the overflow (wait until the subscriber is recorded in _failed_subscribers) before draining, making the test deterministic.
Member
Author
|
Almost identical #68651 merged before. |
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.
The scheduled canary flaked on
test_ack_mode_queue_full_during_fanout_does_not_break_iterationwith aTimeoutError(e.g. the LowestDeps ARM run).Root cause is a race in the test, not the production code. The test
pre-fills trigger 1's subscriber queue with a sentinel so the background poll
task hits
QueueFulland overflow-fails it at fan-out. But it then starteddraining
s_fullimmediately, so depending on event-loop scheduling the draincould consume the sentinel first — leaving the queue no longer full when the
burst was fanned out. The
put_nowaitthen succeeded, the overflow under testnever happened, and the iteration blocked forever (surfacing as the
TimeoutError). It passed most of the time only because the poll task usuallywon the race.
Fix: synchronise on the overflow — wait until trigger 1 is recorded in
_failed_subscribersbefore drainings_full. The test is now deterministic(passes 6/6 locally in ~1s instead of hanging), and the production overflow
path is unchanged.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines