Skip to content

Direct race: deadline for unchosen candidates, and count closing native sockets across races #3243

Done

Description

@devswha

Follow-up from the review of #3222 (Fixes #3209) at head 99133d1. Both reproduced in memory.

  1. 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.
  2. 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.

Activity

  1. devswha commented on Nov 26, 2026

    @devswha
    OwnerAuthor

    #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.

  2. devswha commented on Nov 26, 2026

    @devswha
    OwnerAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions