Skip to content

relay: keep registry forwarders behind a ForwarderRef - #577

Open
afrind wants to merge 1 commit into
relay/registry-park-displacedfrom
relay/registry-forwarder-ref
Open

relay: keep registry forwarders behind a ForwarderRef#577
afrind wants to merge 1 commit into
relay/registry-park-displacedfrom
relay/registry-forwarder-ref

Conversation

@afrind

@afrind afrind commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

In local-forwarder mode a SubscriptionRegistry entry held a shared_ptr to a forwarder that lives on the publisher's executor, so the relay executor could read its counters, run its destructor, or hand it to a subscriber thread that later found it displaced. Entries and every view over them now hold a ForwarderRef: a caller that owns the forwarder pins it inline, and everyone else posts to its executor. Entry cleanup keys off the entry's ForwarderId instead of locking a weak_ptr, which used to decline to erase an entry exactly when its forwarder was already gone, leaving an unfulfilled promise that every later subscriber to that track waited on forever. The local-forwarder fan-out now carries a track name and executor and resolves the publisher forwarder on that executor at the point of use, so a subscriber whose hop lands late fails with "publisher forwarder gone" rather than attaching to a forwarder nobody feeds.


This change is Reviewable

In local-forwarder mode a SubscriptionRegistry entry held a shared_ptr to a
forwarder that lives on the publisher's executor, so the relay executor could
read its counters, run its destructor, or hand it to a subscriber thread that
later found it displaced. Entries and every view over them now hold a
ForwarderRef: a caller that owns the forwarder pins it inline, and everyone else
posts to its executor. Entry cleanup keys off the entry's ForwarderId instead of
locking a weak_ptr, which used to decline to erase an entry exactly when its
forwarder was already gone, leaving an unfulfilled promise that every later
subscriber to that track waited on forever. The local-forwarder fan-out now
carries a track name and executor and resolves the publisher forwarder on that
executor at the point of use, so a subscriber whose hop lands late fails with
"publisher forwarder gone" rather than attaching to a forwarder nobody feeds.
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.

1 participant