2 suggestions
Optional improvements
[suggestion] · HTTP reset test does not enforce receive backpressure
On poll() builds, the HTTP reset test checks only a log message, so it would still pass if error handling read from the paused client before disconnecting.
Location: test/functional/interface_http.py:920 (head).
Details and suggested fix
While ReadyToSend() is true, GenerateWaitSockets() requests only SendEvent. The new error branch preserves that receive pause by skipping Receive(), but the test sends nothing after progress_stalled and checks no received-byte count. Moving the branch below Receive() or removing its continue would still satisfy the log expectation. Queue extra raw bytes after the stall, capture this client's origin, and use a connection-specific unexpected_msgs check for bytes from {origin} through completion of reset handling, rather than stopping at the error log. Successful reads emit that text. This queued-byte check applies to Linux/poll() and assumes recv() returns buffered input before reporting the reset, as the P2P counterpart also assumes.
[suggestion] · HTTP reset test never checks server-side client removal
The reset section never verifies server-side removal, and on select() builds its empty expected_msgs list makes the server-side assertion vacuous.
Location: test/functional/interface_http.py:918 (head).
Details and suggested fix
assert_debug_log() returns as soon as all expected messages are present, including immediately after its first log read when the list is empty. On poll() builds, the error message is emitted before client->Disconnect(), so dropping that call while retaining the log and continue would still pass, leaving cleanup to another path such as the idle timeout. Capture this connection's origin or id before closing it and require its backend-independent Disconnecting HTTP client message on every platform, alongside the existing poll-only error expectation. Allow enough time for Windows/select() to report the reset.
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
The select exception set has a necessary connect-time role, but is not a general established-connection error channel. Windows reports failure of a nonblocking connect through that set, so removing exception monitoring everywhere would lose a required connection-completion signal.
The predecessor proposal explicitly limits exception monitoring to connection establishment. At the pinned head, ConnectToSocket requests ConnErrorEventFlag and still checks SO_ERROR after readiness: waking is not equivalent to a successful connection. Established connections do not opt in.
On established connections, select exceptions can indicate TCP urgent data that ordinary recv does not return. Treating this indication as ordinary receive readiness can repeatedly wake the caller without consumable input. The predecessor's chosen approach was to stop monitoring those exceptions, rather than make urgent bytes part of the application stream with SO_OOBINLINE.
This explains why the pinned socket abstraction separates connect-time exception monitoring from normal receive readiness. It also explains the intended compatibility behavior: an urgent indication need not disconnect the peer or become a received protocol byte, while ordinary traffic must remain processable.
Error or hangup notification must not be treated as permission to bypass receive backpressure. The predecessor discussion explicitly proposed disconnecting when no read was requested, explaining that this prevents reading while paused, and separated that cleanup from the select exception fix.
The pinned base omits receive interest when P2P reads are paused, yet poll can return POLLERR/POLLHUP independently of requested events. Both head handlers distinguish requested receive interest from returned error readiness before performing I/O. The historical rationale is preservation of the pause boundary, not consumption of one final input batch.
Ralph's inferences
When receive interest was requested, an error/hangup indication is not treated as proof that no buffered input remains. The existing contract lets recv resolve the condition: positive bytes are accepted and accounted, zero means EOF, and a permanent receive error triggers disconnect. This is an opportunity to consume buffered input, not an unconditional promise to drain everything before disconnection.
Both base handlers receive on read readiness or error readiness. The head retains that path when reads were requested. P2P sending precedes receiving and may already close the socket on failure, so the distinction to preserve is conditional buffered-input handling rather than blanket immediate close on every poll error.
Backpressure protects bounded processing and output queues from slow readers, but must still permit progress. The pinned P2P code explains that successful sending with output left over suppresses receiving to apply TCP flow control; suppression is conditional on actual send progress to avoid both sides waiting forever without receiving.
This supplies the resource-control reason behind respecting paused reads. In the no-read-requested error/hangup branch, disconnecting does not authorize additional kernel input to enter application buffers. For HTTP, the head similarly requests disconnect and skips that iteration's send, receive, and request-dispatch work; the inspected code does not establish a guarantee to finish queued responses after an error.
Unresolved disagreements
The predecessor discussion contains differing assessments of whether an explicit paused-read error/hangup disconnect was necessary on Linux: one comment says it was needed for other poll implementations but not Linux, while another argues that Linux's existing handling was only incidentally sufficient. The inspected record separates this question from the select fix without resolving the broader platform guarantee.
Historical concern about portability should not be mistaken for proof that every poll error or hangup has identical send, buffered-input, or close behavior. The pinned change can be understood through its requested-read distinction without assuming that stronger claim.