* [TransferEngine] Bound handshake-port connect() with a timeout
A blocking connect() in SocketHandShakePlugin has no deadline:
SO_RCVTIMEO does not apply to connect(), so a connect to an
unroutable address stalls for the kernel's full TCP SYN-retry
cycle, which is minutes with default tcp_syn_retries. During
rolling deployments, torn-down peers leave unroutable IPs, and
these connects run on RDMA worker threads (performPostSend ->
setupConnectionsByActive), where the stall also delays CQ polling
for transfers to healthy peers.
Connect in non-blocking mode and bound the wait with poll(),
checking SO_ERROR for the handshake verdict, then restore blocking
mode for the request/response exchange. Applies to all outbound
handshake-port RPCs (QP handshake, probe, notify, metadata
exchange). Timeout defaults to 5 seconds, tunable via
MC_HANDSHAKE_CONNECT_TIMEOUT.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* [TransferEngine] Fail immediately when poll() reports connect timeout
Review feedback: poll() returning 0 already means the timeout
expired; fail with ETIMEDOUT directly instead of looping back to
re-derive it from the clock. Also makes the wait robust to
wall-clock steps, since poll()'s own accounting decides.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>