Repository navigation
Pause a stopped listen event instead of accepting through it (#305) - #306
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
|
ASan run of |
This was referenced Sep 30, 2026
This was referenced Oct 1, 2026
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 #305. libuv cannot undo
uv_listen, sostop()now pauses: the connection callback leaves the connection unaccepted, and libuv stops watching the socket (Unix) or posts no new AcceptEx (Windows). The firststart()runsuv_listen; a later one unpauses and delivers the held connection from auv_idle_ton the next tick. The delivery stops if a callback pauses or closes the listener. The firststop()switches a Windows TCP listener to single accept, so a listener that is never stopped keeps libuv's default. A faileduv_accepton Unix re-arms the watcher withuv_listen, since libuv restarts it only after a successful accept.Reviewed before code by a Critic and a Sage (rejected: a
uv_pollaccept loop), and on the diff by a Critic; its four findings are addressed in this commit.Evidence:
sapi/asynctest/tests/test_listen_pause.c(true-async/php-src PR on branchlisten-pause-test): 5 of 5 cases red onmain, green here, 3 of 3 runs.h1/062,h1/063,h1/064: 503 onmain, 10 of 10 green here; the server's full phpt suite, 516 of 516 green (25 skipped).mainon this machine. They include php-src helpers through../../../../, which misses whenext/asyncis a symlink.Not measured: the accept rate of a Windows listener after its first pause.