Skip to content

MoQForwarder: restore passive-subscriber guard in duplicate beginSubgroup#326

Merged
gmarzot merged 1 commit into
mainfrom
fix/passive-duplicate-subgroup
Jul 22, 2026
Merged

MoQForwarder: restore passive-subscriber guard in duplicate beginSubgroup#326
gmarzot merged 1 commit into
mainfrom
fix/passive-duplicate-subgroup

Conversation

@gmarzot

@gmarzot gmarzot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Problem

moqx sync PR openmoq/moqx#499 fails on all 3 platforms: DuplicateSubgroupCancelledWhenNoActiveConsumers/LocalForwarderMT segfaults (ASAN teardown use-after-free).

Root cause: the sync-conflict resolution in #324 (pin 0d9f3af) took upstream e848acf5 ("Gate subgroup reopen on v18 forward resume") verbatim for the duplicate-subgroup block in MoQForwarder::beginSubgroup, dropping the openmoq guard from 12b24a60: when a duplicate subgroup resets a passive subscriber's stale consumer (the relay's top-N/cache observer chain), it must not count toward anyReset. Without the guard, the passive local-forwarder subscriber masks the "no active consumers" signal, the duplicate beginSubgroup succeeds instead of returning CANCELLED, and the moqx test's dupRes.error() on a success value throws, skipping cleanup and segfaulting in teardown.

Same failure pattern as the recurring TRACK_FILTER kParamAllowlist sync casualty.

Fix

  • MoQForwarder::beginSubgroup: restore the !sub->passive guard on anyReset, and exclude passive subscribers from upstream's new anyReopenCandidate as well (a passive sub with no subgroup entry would otherwise mask CANCELLED the same way). Reconciles our passive-subscriber feature with upstream's v18 reopen logic rather than reverting it.
  • Two regression tests in OpenMOQForwarderTest so moxygen's own CI catches the next sync that drops this guard, instead of it surfacing two repos downstream in moqx.

Validation

  • OpenMOQForwarderTest: 13/13 pass with the fix; both new tests fail against the unguarded post-sync code (verified by stashing the fix).
  • Upstream MoQForwarderTest: 26/26 pass — the v18 forward-resume reopen behavior is unchanged for real subscribers.

Follow-up

On merge, snapshot publish → bump the moxygen pin on the existing sync-moxygen/* branch in moqx (keeping the compile fix already there) so #499 goes green and auto-merges.


This change is Reviewable

…roup

The sync merge of upstream e848acf ("Gate subgroup reopen on v18
forward resume") rewrote the duplicate-subgroup block in
MoQForwarder::beginSubgroup and dropped the openmoq guard added in
12b24a6: a passive subscriber (the relay's top-N/cache observer
chain) whose stale consumer gets reset must not count toward anyReset,
otherwise CANCELLED never propagates to the publisher once all real
consumers have stop_sent.

Restore that guard and also exclude passive subscribers from the new
anyReopenCandidate check - a passive sub with no subgroup entry would
mask CANCELLED the same way.

Add two regression tests so moxygen CI catches the next sync that
drops the guard, instead of it surfacing two repos downstream as the
moqx DuplicateSubgroupCancelledWhenNoActiveConsumers/LocalForwarderMT
segfault (moqx #499).
@gmarzot gmarzot self-assigned this Jul 22, 2026
@gmarzot
gmarzot requested a review from afrind July 22, 2026 16:15
@gmarzot
gmarzot merged commit 3ff89af into main Jul 22, 2026
6 checks passed
@gmarzot
gmarzot deleted the fix/passive-duplicate-subgroup branch July 22, 2026 17:16
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