Repository navigation
Conversation
The test published an event every 100ms from a client thread under a 300ms response timeout, so any 200ms stall between two writes on a loaded runner timed the stream out and the client read end of stream (exit 13). A pause past the timeout reproduces that exit exactly. Nothing in the wake path or http 0.25's lingering close is involved: the timeout closes the connection before any close the client could race. The client now publishes the first event before the request, so the stream opens with it and its arrival shows the waker is published, replacing the stream_ready poll. Each later event is published once the one before it is on the wire, after a 10ms pause, until the stream has lived three timeouts, and the stream ends when the client marks it done. A stall now has to eat 290ms of the 300ms timeout, not 200ms.
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 #201
What
Cause.
event_scenariopublished one event per 100msos.sleepfrom the client thread under a 300msresponse_timeout_ns, which http re-arms on each write the client accepts. A stall of 200ms or more between two writes, on either thread, is a legitimate timeout: the server closes the connection and the client's read sees end of stream, which is exit 13. Setting the pause past the timeout reproduces exit 13 exactly. The failing leg ran slow overall (laurel.serve2.6s against 1.8s and 2.0s on the passing darwin legs). The wake path (context.waketohs.waketoio_runtime.wake) latches correctly, and http 0.25's lingering close is not involved, because the timeout closes the connection before any close the client could race. No library bug, so the fix is in the test.Fix. The test now synchronizes on the stream itself:
stream_readypoll.stream_done) after it has livedEVENT_LIFETIMES(3) response timeouts by the client's monotonic clock. The fixedEVENTScount is gone.Nothing that paces a producer against a wall-clock server deadline can be fully deterministic without an injectable server clock, which http does not offer.
Ran locally:
mach test . --filter serve(4 passed) andmach fmt --check ..Checklist