Repository navigation
tests: the non-reading SSE tests' producers drop on a full queue before WriteTimeout, as the small-events ones do (v1.6.0, Refs #888 #1104) - #1164
Merged
Conversation
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Flakes lane.
middleware/sseTestNonReadingClientEndsStream888/adaptive/async/steadyfailed in the Coverage job of #1150 (head 323fe30, run 40737498877, job 122989896907):OnDisconnect ran 816.6ms after connect, before WriteTimeout 1s: the stream was ended by something other than the stall bound(epoll was the active engine of the adaptive server). Tests only; the product did what it is configured to do. Refs #888, Refs #884, Refs #1104, Refs #1150Verdict: the test's producer, not the engine
The 1 s lower bound is right (the stall bound, "no progress for WriteTimeout", must not end a stream earlier; it ends the healthy runs at 1.06 to 1.3 s after connect, never before 1.0 s in about 500 runs here). What ended this stream at 0.82 s was not the stall bound: it was
OnSlowClientansweringClientPolicyClosebecause the 4-slot send queue was full. The "steady" producer sends one 1 KB event every 5 ms starting 700 ms after the handler began; a drain goroutine that is not scheduled for about 20 ms (a runner starved under-raceand-covermode=atomic) leaves the queue full, and the producer's own policy closes the stream (700 ms settle + ~80 ms into the trickle, 0.82 s after the dial, with the handler starting a few tens of ms after it). The test already knew this failure:dropEarly("CI saw cuts at 0.5 s, when the socket fills") makes a full queue drop an event for the first WriteTimeout, so the lower bound tests only the stall bound; only the two small-events producers had it set.Evidence
epoll/{async,sync}/steady(dockergolang:1.27.3,-race -covermode=atomic, two test processes on--cpus 1; 0 in about 200 runs at--cpus2, 0.5 and 0.3 and GOMAXPROCS 1 and 4). The one:OnDisconnect ran 787.9ms after connect, before WriteTimeout 1s ... (OnSlowClient answered ClientPolicyClose 777ms after the handler began (a full queue)), i.e. 77 ms into the trickle. The same shape as CI's 817 ms.steady-flood, which sends 50 events back to back where the trickle starts (what a stalled drain goroutine does to the pace, made certain): fails 20 of 20 on main at 0.72 s with the full-queue message.steady-floodand the h2c twin pass 50 of 50 (-count=10), the 240-run shape above passes 240 of 240, and one whole pass ofTestNonReadingClientEndsStream888,TestSlowReadingClientKeepsStream888,TestNonReadingH2CClientEndsStream884is green (epoll and std cells; the io_uring cells cannot run in this docker).Commits
tests: TestNonReadingClientEndsStream888 says whether a full queue ended the stream before WriteTimeout(diagnostic only: the failure message now names the cause).tests: ... gets a producer whose queue overflows before WriteTimeout(red on main).tests: the non-reading SSE producers drop on a full queue for the first WriteTimeout, so the lower bound tests the stall bound only:dropEarlyonsteady,steady-floodandsparse, and on both producers ofTestNonReadingH2CClientEndsStream884(same lower bound, same 5 ms trickle). After WriteTimeout the policy is Close as before, so a stream still ends by the stall bound or by a full queue at or after it; the lower bound is then true by construction.Not verified / left alone
TestSlowReadingClientKeepsStream888(the control) has the same exposure the other way round: a full queue closes a stream that must live, and its producer (4 KB every 10 ms) has nodropEarly. Not changed here.Release note
None (tests only).