Mooncake/docs/source/design/transfer-engine
Dao007forever 474f67852a
[TransferEngine] Bound handshake-port connect() with a timeout (#2425)
* [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>
2026-06-11 11:26:25 +08:00
..
ascend_direct_transport.md change ascend direct transport docs 2026-02-11 16:53:55 +08:00
ascend_transport.md [CI] update ascend ci and docs (#1683) 2026-03-17 20:34:42 +08:00
cpp-api.md [Docs]: fix docs config, remove autodoc2, archive zh docs (#2218) 2026-05-26 15:29:37 +08:00
efa_transport.md [TE] fix(efa): short-circuit same-process GPU loopback to avoid libfabric SHM segfault (#2298) 2026-06-04 11:17:17 +08:00
heterogeneous_ascend.md [Doc] Merge doc to docs (#1153) 2025-12-15 12:08:49 +08:00
index.md [TransferEngine] Bound handshake-port connect() with a timeout (#2425) 2026-06-11 11:26:25 +08:00
kunpeng_ub_transport.md [CI] change dependency `libboost-all-dev` to `libboost-dev` (#2129) 2026-05-19 08:28:01 +08:00
sunrise_link_transport.md [TENT][Sunrise] Add sunrise_link transport, platform support, and UT … (#1915) 2026-04-28 09:47:30 +08:00
transfer-engine-bench-tuning.md [Doc] Merge doc to docs (#1153) 2025-12-15 12:08:49 +08:00