Repository navigation
Disable Nagle on accepted HTTP streaming connections - #929
Conversation
cwschroeder
left a comment
There was a problem hiding this comment.
Source review of 4e31bd79: no blocking issue found. The listener keeps ownership until socket configuration succeeds, closes the accepted descriptor on failure, and checks stop again on the next iteration. After handoff, the server retains its existing connection cleanup.
The refreshed Linux qualification has completed successfully: No GPU run, on this exact head. All four upstream checks are green. The new IPv4/IPv6 test is imported through server/root.zig and included in Linux zig build test, so the description's pending-Linux note can be updated.
One nonblocking test improvement: bound the wait for accept. If socket configuration fails, production correctly closes and retries, but the test's permanently false stop flag leaves it waiting for another client. A bounded stop watchdog would turn that case into a useful test failure.
The evidence proves the socket option is enabled; a streaming-latency gain remains unmeasured.
|
Thanks for the liveness review. Fixed in At head |
cwschroeder
left a comment
There was a problem hiding this comment.
Scoped watchdog re-review of 7b94b5e6: the nonblocking liveness note from my earlier review is addressed. Astra found no new material issue in this test delta.
The actual listener root passes all seven tests in Debug and Fast on macOS arm64 with Zig 0.17.0, including accepted IPv4/IPv6 TCP_NODELAY and the no-client path. In a temporary source copy, removing only the watchdog stop request makes the direct no-client test executable exceed an external three-second limit; the unchanged implementation passes. Only that owned test process was terminated.
The watchdog remains alive until join on both success and timeout. The 20-ms parameter requests stop; the existing 200-ms polling controls when accept observes it, so this is no exact-deadline or latency claim. Whole-tree format, whitespace and lean pass (517/517 against main 6ee828c2, zero new). All four current-head checks, including Linux No GPU, are green. This rechecks the bounded test behavior and socket option, with no measured serving-latency improvement.
|
Thank you, @akol1, for bounding the accepted-stream check and joining its watchdog before return. We merged your work for 1.1.0 in 01ead20. The listener owns an accepted descriptor until The change sets the socket option and keeps the test's state alive for its watchdog. We have not attached a latency improvement claim. Posted by Ash's AI Assistant Synthena |
…LAY), so streamed tokens leave as they are written
Accepted HTTP connections retain Nagle buffering, which can delay small incremental response writes. Set TCP_NODELAY before handing an accepted connection to the server; close and retry if configuration fails.
Real IPv4/IPv6 loopback tests check the accepted socket option. Their accept wait now has a stop watchdog, with a no-client regression that exercises timeout shutdown. The watchdog joins on every return. This is a socket-option and test-liveness change; no measured streaming-latency improvement is claimed.
Source:
7b94b5e6d20a4a18b7d8d4707e6c640049044958; current main base:b090e3b19014bfa1eb2b7f38ea3cc4d39abec9be. Zig 0.17.0, macOS arm64:zig build native -Dcpu=apple_m1 -Dversion=1.0.0: 45/45 steps succeeded.zig build test test-kernel-contract test-golden fuzz-cortheon -Dcpu=apple_m1: 214/214 steps succeeded; 3,018/3,028 tests passed, ten explicit skips.Current-head public CI: all four checks pass (format, desktop, mobile, and the Linux No GPU workflow). The Linux run executes the IPv4/IPv6 socket-option and no-client watchdog tests through the standard host root. No GPU kernel changes.