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
A connection that arrives while the listeners are paused is answered 503 instead of waiting in the backlog #359
http_server_pause_listeners (src/http_server_class.c) calls stop() on each listen event and expects new connections to wait in the kernel backlog until the resume. php-async cannot stop a uv_listen (true-async/php-async#305), so accepts go on: each connection that arrives during a pause reaches http_server_accept_callback, and the hard-cap safety net answers it 503, a path its own comment calls rare.
Reproduction: tests/phpt/server/h1/062-h1-paused-listener-leaves-the-backlog.phpt, setMaxConnections(2), two parked requests, a third client during the pause: 503 Service Unavailable on 5 of 5 runs, while getTelemetry()['listeners_paused'] reads true.
The comments at the backpressure primitives are wrong on a second point: under SO_REUSEPORT the kernel keeps hashing new connections to a paused worker's socket, so they wait for that worker (or are dropped once its backlog is full) rather than going to another one.
The fix is in php-async. This repository gets the tests (062, a burst past the cap, a re-pause during delivery), corrected comments, and two counters: accepts_refused_at_cap_total (nonzero means a pause did not hold) and accept_errors_total (accept failures were dropped without a trace).
Activity
docs(plan): record the ASan run of the listen pause test (#359)
docs(plan): record the Windows accept order and the port race; build …
fix(core): serve a connection that arrives while the listeners are pa…
EdmondDantes commentedon Sep 30, 2026
Fixed by #360 with true-async/php-async#306 and #307.
docs(plan): close S1, the paused listener (#359) (#361)