Files
fips/src
Johnathan Corgan af40a158fe Log the OS error and peer when a TCP connect fails
Trying every resolved address moved the connect into
connect_to_any_addr, which maps any I/O failure to ConnectionRefused
and kept the real error only at trace level with no transport or peer
fields. The background connect's debug line then printed the variant,
whose text is always "connection refused", so an operator at debug
level saw that for "No route to host" and "Network is unreachable" too,
including for a single numeric address.

connect_to_any_addr now takes the transport id and the peer address,
logs the last candidate's OS error at debug level with both, and names
the peer in its no-addresses error as the resolver did before. The
background path's own refusal line is dropped, since it would repeat
the same failure without the error. Connect-on-send, which logged
nothing on a refusal, now gets the same debug line.

A test captures the log and requires the debug line to carry the OS
error, transport id and peer. It registers the log callsite before
installing the capture, because a parallel test that registers it
first while the capture is the only subscriber caches its own thread's
"never" interest and the event is lost.
2026-09-30 17:24:41 +00:00
..