1 suggestion
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Optional improvements
[suggestion] · Failed-connect tests do not guard the explicit ErrorEvent request
The current code preserves Windows connect-failure detection, but the tests do not directly guard against dropping ErrorEvent and making refused non-blocking connects wait until timeout.
Location: src/netbase.cpp:606 (head).
Details and suggested fix
Previously, requesting RecvEvent implicitly added the socket to the select() exception set. Now ConnectToSocket() must request ErrorEvent explicitly because Windows reports failed non-blocking connects only in that set. Removing the flag would leave Wait() waiting until timeout, and ConnectToSocket() would return before checking SO_ERROR. The new wait_ignores_urgent_data test covers suppressing exceptions on established connections, not preserving failed-connect notification. The closed-port cases in interface_bitcoin_cli.py check the final error, which remains the same after a timeout, without checking elapsed time. Add a Windows-enabled test that calls ConnectDirectly() against a refused loopback port with a generous timeout and asserts failure substantially before that timeout. Allow enough margin for Windows connection-refusal retries. This would protect the request mask at the actual caller.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: The urgent-data test does not verify blocking (earlier report)
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
Coupling exception monitoring to RecvEvent was introduced to narrow previously unconditional select exception monitoring, reduce cross-platform inconsistency, and improve testing coverage—not to add a receive-specific protocol requirement. The introducing proposal explicitly retained exception monitoring because Windows needs it to detect failed connection attempts early.
At the pinned base, requesting RecvEvent adds the socket to both the read and exception sets. This coupling was a compatibility compromise that preserved Windows connect-failure detection while reducing monitoring of sockets not being read. The current change replaces that implicit coupling with an explicit request from ConnectToSocket.
Exception readiness on established connections was also exposing TCP urgent data that ordinary recv() would not return. The historical urgent-data proposal described repeated select readiness on some platforms as undesirable, whereas Linux poll without urgent-data monitoring was indifferent. It stated that #36665 had already prevented the associated loss of progress or crash.
This distinguishes exceptional readiness from a generic indication that ordinary receive processing can make progress. In the inspected historical record, established-connection urgent-data notification was behavior to eliminate or neutralize, not a requirement to preserve. The proposal also emphasized reducing custom behavior on less-tested platforms after a socket-related security vulnerability.
Ralph's inferences
The inspected evidence supports separating connect-completion monitoring from established-connection receive monitoring, but does not prove that failed Windows connects are the only possible supported-platform dependency.
The head explicitly requests ErrorEvent during asynchronous connection establishment and then reads SO_ERROR after readiness, preserving the distinction between notification and connection success. Established receive waits no longer request select exceptions, while the poll backend still reports POLLERR and POLLHUP independently of requested events. Thus the historically identified Windows requirement remains represented, but broader platform completeness cannot be concluded from the retrieved record alone.