You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
stop() on a listen event does not stop accepting #305
libuv_listen_stop (libuv_reactor.c) only zeroes loop_ref_count and decrements the event count: libuv has no call that undoes uv_listen (checked in libuv v1.52.1: uv__tcp_listen starts the POLLIN watcher, and uv_read_stop is a no-op on a listening handle because UV_HANDLE_READING is never set). A stopped listen event therefore keeps accepting, and every connection reaches its callbacks.
Consumer impact: true-async-server pauses its listeners at its connection cap so that new connections wait in the kernel backlog; instead each one is accepted and answered 503 by the server's safety net. Reproduced 5 of 5 by the server's tests/phpt/server/h1/062-h1-paused-listener-leaves-the-backlog.phpt.
Fix (reviewed by a Critic and a Sage before code): pause by leaving the connection unaccepted. On Unix libuv then stops watching the socket itself (unix/stream.c:528-531) and restarts on the next successful uv_accept; on Windows a completed AcceptEx stays pending and is not re-posted. The first start() runs uv_listen; a later one unpauses and delivers the held connection on the next loop tick. A uv_poll accept loop was rejected: several polls on one socket busy-loop on Windows, EMFILE would spin, and named pipes cannot be polled.
Activity
Merge pull request #38 from true-async/listen-pause-test
Merge pull request #306 from true-async/listen-pause
EdmondDantes commentedon Sep 30, 2026
Fixed by #306.
Merge pull request #307 from true-async/listen-single-accept