Skip to content

feat: implement rendezvous timeout feature in MoqxRelay - #549

Open
akash-a-n wants to merge 3 commits into
mainfrom
d18/rendezvous-timeout
Open

feat: implement rendezvous timeout feature in MoqxRelay#549
akash-a-n wants to merge 3 commits into
mainfrom
d18/rendezvous-timeout

Conversation

@akash-a-n

@akash-a-n akash-a-n commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
  • Introduce PendingRendezvous structure to manage parked subscriptions.
  • Add support for RENDEZVOUS_TIMEOUT in subscription handling.
  • Implement wake and erase functions for pending rendezvous.
  • Add tests for rendezvous timeout scenarios in MoqxRelayRendezvousTests.

This change is Reviewable

@akash-a-n
akash-a-n force-pushed the d18/rendezvous-timeout branch from d1d0f2d to 2718863 Compare August 6, 2026 13:28
@akash-a-n
akash-a-n force-pushed the d18/rendezvous-timeout branch from 2718863 to f48ea74 Compare August 17, 2026 13:23
@akash-a-n
akash-a-n force-pushed the d18/rendezvous-timeout branch 5 times, most recently from a383ff1 to ffede66 Compare August 27, 2026 18:31

@afrind afrind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(C) Correctness

  • LF claim race — a woken SUBSCRIBE fails despite a publisher being available, because a neighbouring subscriber's
    failed claim is still open when it joins. Surfaces as INTERNAL_ERROR "local forwarder setup failed". Not
    reproducible in the fixture.
  • Ready-but-draining forwarder short-circuits the park → makeAddSubscriberError instead of waiting. Matches the
    non-rendezvous path, so possibly intended.

(T) Test coverage

  • The co_stopped_may_throw cancellation branch.
  • Trie pruning after a timeout — unobservable today; extracting the trie into its own class (as NamespaceTree is)
    makes it testable.
  • The 30s clamp — not observable without waiting it out.

Also, I think we should encapsulate the rendezvous trie into it's own class/file.

@afrind made 1 comment.
Reviewable status: 0 of 6 files reviewed, all discussions resolved.

akash-a-n and others added 3 commits September 7, 2026 19:07
- Introduce PendingRendezvous structure to manage parked subscriptions.
- Add support for RENDEZVOUS_TIMEOUT in subscription and publish flows.
- Implement wake and erase functions for pending rendezvous.
- Add tests for rendezvous timeout scenarios in MoqxRelayRendezvousTests.
findPublisherSession() read publisherSession_ off the last node the walk
reached. addPublish() and subscriber registration also create nodes carrying no
publisher, so a SUBSCRIBE descending through one failed even when a broader
namespace above it had a publisher, and a publisher at the root was never found
at all. It now keeps the deepest publisher it passes, seeded from the root.
Nothing else needed a prefix match, so MatchType is gone.

Ports moxygen a682b57a, which never reached moqx because NamespaceTree is a
separate implementation of the same tree.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01USngBUv8nzrbMHQCokzJBF
makeUpstreamSubReq stripped track request param key 0x04 unconditionally. That
key is RENDEZVOUS_TIMEOUT only at draft 18+; below it the same key is
MAX_CACHE_DURATION and is legal to forward, so a pre-v18 client's value was
dropped on the way upstream.

The two halves now sit where their information lives. The downstream half is
consumed by the screen that already reads it -- takeRendezvousTimeout(), renamed
from requestedRendezvousTimeout since it no longer just reads -- so a v18
client's per-hop value dies at ingress. makeUpstreamSubReq strips only when the
upstream is v18+ and would misread the key. Net effect matches moxygen's
downstream-or-upstream-is-v18 gate: forward only when both sides are pre-v18.

Also: park timers fire on the relay's own EventBase instead of folly's global
timekeeper thread, and the clamp log drops from WARN to DBG1 -- the value is
client-supplied and nothing acts on it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01USngBUv8nzrbMHQCokzJBF
@akash-a-n
akash-a-n force-pushed the d18/rendezvous-timeout branch from 3080345 to 454b75d Compare September 7, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants