1 minor finding · 2 suggestions
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Findings
[minor] · Partial reads can stall the reset test before the reset
In p2p_socket_errors.py, a partial read of the initial ping batch can pause receiving before the byte-count target is reached; no failing environment was identified.
Location: test/functional/p2p_socket_errors.py:108 (head).
Details and suggested fix
check_reset_while_sending() sends 100 v1 pings, totaling 3,200 bytes, and waits for all those bytes to be counted. With -maxreceivebuffer=1, completed messages exceeding 1,000 bytes of queued memory set fPauseRecv after each successful recv(). If a read contains enough complete pings to cross that limit but not the whole batch, subsequent socket waits omit RecvEvent. During the intended output stall, pending getdata requests or fPauseSend prevent the processing queue from draining, so the remaining bytes stay in the kernel and the equality wait times out before exercising the reset. TCP does not preserve write boundaries. Replace the initial batch with one well-formed message whose queued memory alone exceeds the limit, such as a sufficiently large unknown-type message, and wait for its complete byte count. Since only complete messages enter the processing queue, fragmentation of that message cannot trigger the pause prematurely.
Optional improvements
[suggestion] · Failed-connect exception monitoring lacks regression coverage
The new sock_tests case checks exclusion of exception monitoring, but not the connect-time opt-in needed to detect refused asynchronous connections on Windows before the timeout.
Location: src/test/sock_tests.cpp:63 (head).
Details and suggested fix
wait_ignores_urgent_data requests only RecvEvent, so it would still pass if the new ConnErrorEventFlag gate never registered the exception set. Windows reports failed non-blocking connections through that set; losing it would make ConnectToSocket() wait until its timeout. The existing bitcoin-cli closed-port test checks only the eventual connection error, so it does not directly assert prompt detection. Add a socket test that obtains an unused loopback port, starts a non-blocking connection to it, and, when connection establishment is asynchronous, requires Wait(RecvEvent | SendEvent | ConnErrorEventFlag) to return nonzero events well before a generous timeout, with nonzero SO_ERROR. Running this on Windows would cover the required half of the gate.
[suggestion] · Early poll() disconnects discard socket error details
With -debug=net, receive-paused connections closed by the new branch lose the error detail that the previous failed-send path logged.
Location: src/net.cpp:2214 (head).
Details and suggested fix
When poll() reports POLLERR or POLLHUP without a receive request, this branch closes the socket before attempting I/O. In cases where SendEvent was also reported and the send failed permanently, the previous handler logged NetworkErrorString(nErr); the replacement logs only socket error or hangup, obscuring distinctions such as reset versus timeout. Before closing, query SO_ERROR under m_sock_mutex and append its decoded value when nonzero, while handling lookup failure separately. This preserves useful pending-error diagnostics without changing the disconnect decision, although it need not reproduce the exact errno a send would have returned.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]:
ConnErrorEventFlagunnecessarily depends onRecvEvent(earlier report)
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Unresolved disagreements
The historical record contains a substantive competing argument for SO_OOBINLINE: its proponent regarded excluding urgent bytes from the ordinary stream as the broken default, cited RFC 6093's intended stream semantics, and preferred consuming unexpected bytes so that protocol processing could disconnect the peer. The opposing position held that an application with no use for urgency should ignore the mechanism instead. The inspected record does not establish a general resolution of that semantic disagreement.
Ignoring urgent indications is a choice about what reaches the P2P byte stream, not merely another spelling of SO_OOBINLINE. The platform requirement explains retaining exceptions during connection establishment, but does not itself settle this separate policy tradeoff.