UCT/UD: Remove stale private UD connections - #11822
Conversation
d7a9d80 to
c47656a
Compare
c47656a to
183a66d
Compare
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Starting review — findings will be posted here when done. |
|
self->config.keepalive_interval can be peer_timeout/3 (~10s at defaults), while the timer wheel resolution is tick/4 (~2.5ms) with 1024 slots (~2.5s max range). ucs_wtimer_add clamps deltas beyond the wheel range to the last slot, so uct_ud_ep_check_peer fires early and simply re-arms until idle_time reaches keepalive_interval. Functionally correct but the intent reads as 'fire once per keepalive_interval' — consider adding a code comment noting the clamp. |
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
evgeny-leksikov
left a comment
There was a problem hiding this comment.
LGTM, please check the room for optimization of eps GC in the comment. Can be separate PR.
| } else if (ep->flags & UCT_UD_EP_FLAG_PRIVATE) { | ||
| uct_ud_ep_check_peer(iface, ep); |
There was a problem hiding this comment.
what if we add the same logic to uct_ud_ep_free_by_timeout? I think we can reduce linger time if peer already gone => reduce and number of stale EP
There was a problem hiding this comment.
Yes, I think this optimization makes sense, but can be done in a separate PR.
What?
Release a UD private endpoint once its peer is gone, instead of keeping it forever.
Why?
On first UCP wireup request:
A private endpoint is created internally on CREQ, has no UCP endpoint above it => so keepalive never checks it => and UD never signals a closed remote endpoint.
When remote peer connection dies => private UD connection stays forever pointing at a dead ep_id
On UCP wireup reconnect request =>
uct_ep_create()matches that stale endpoint by addr+conn_sn => reuses it as is => wireup reply goes to the dead ep_id => connection never completesHow?
Probe an idle private endpoint from the UD timer with the existing
uct_ud_ep_check(), skipping it while the peer keeps sending. The threshold is the upper layer's keepalive interval. An alive peer acks; otherwise peer_timeout fires and the endpoint leaves connection matching immediately.