You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Direct race: deadline for unchosen candidates, and count closing native sockets across races #3243
Follow-up from the review of #3222 (Fixes #3209) at head 99133d1. Both reproduced in memory.
Overflow candidates can lock another device out of its replacement sessions (server/relay/admissions.ts:66). With devices A and B each holding four chosen sessions, A can authenticate three more race candidates and keep them alive without opening streams (no post-authentication deadline; keepalives answered). The shared count reaches 11 and every new B candidate is closed at over > 3, although B may replace its own oldest session. Give unchosen candidates a short deadline after authentication and count them per device key.
Native socket accounting ignores sockets still closing (src/lib/relay/transport.ts:369). The two-socket budget is local to one openDirect call; losers of an earlier race or a probe can still hold the iOS/Android plugin's slots, so the next probe or race is refused (too_many) and not retried when they close. Track open-or-closing native sockets across calls, or retry refused carriers when a slot frees.
#4850 fixes this issue's reproduced lockout and its part 2. The lockout: one device's unused racing carriers no longer stop another device at its share from replacing its own sessions, because racing carriers are now counted per device. Part 2: a direct socket the OvisDirect plugin refuses as full (too_many) is asked for again once the plugin reports a close.
The remaining item, a post-authentication deadline for unchosen candidates, moves to #3310. In #3306 a server-only timer closed race winners the app had kept but not used yet (the app connects on wake and switches carriers while idle), so the deadline needs the app-to-PC "kept" signal described in #3310 first. This issue can close once #4850 merges.
Fixed by #4850 (27b8722): racing carriers are counted per device, and a direct socket the plugin refuses as full is asked for again once a place frees. The post-authentication deadline for unchosen candidates continues in #3310.
Activity
devswha commentedon Nov 26, 2026
#4850 fixes this issue's reproduced lockout and its part 2. The lockout: one device's unused racing carriers no longer stop another device at its share from replacing its own sessions, because racing carriers are now counted per device. Part 2: a direct socket the OvisDirect plugin refuses as full (
too_many) is asked for again once the plugin reports a close.The remaining item, a post-authentication deadline for unchosen candidates, moves to #3310. In #3306 a server-only timer closed race winners the app had kept but not used yet (the app connects on wake and switches carriers while idle), so the deadline needs the app-to-PC "kept" signal described in #3310 first. This issue can close once #4850 merges.
fix(relay): count racing carriers per device, and ask again for a dir…
devswha commentedon Nov 26, 2026
Fixed by #4850 (27b8722): racing carriers are counted per device, and a direct socket the plugin refuses as full is asked for again once a place frees. The post-authentication deadline for unchosen candidates continues in #3310.