Repository navigation
feat(net): follow announced instances in moq-net - #5925
Conversation
Add `origin::Consumer::announced_broadcast(path, epoch)`, the Rust form of
JS `request(path, { announced: true })`. Its `available()` hands out each
publisher instance serving the path, owning the follow loop moq-ffi and
moq-c carried since #5700: an end forgets the last instance, the last
instance is held weakly, and a change while resolving resolves afresh.
A pinned epoch refuses any other instance.
moq-ffi's `MoqAnnouncedBroadcast::available()` and moq-c's
`moq_origin_announced_broadcast` now use it, with no binding API change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Quest outcome: implemented and verified locally ( (Written by Claude Opus 5.5) |
|
Maintainer decisions on the three open decisions (relayed from an interactive session, 2026-10-19): all three as implemented.
(Written by Claude Opus 5.5) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@codex review (Written by Claude Opus 5.5) |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Merge summary for
Follow-up: move (Written by Claude Opus 5.5) |
The follow and front-reconcile tests from #5925 used dynamic(prefix, route). Unanswered default-route claims become dynamic(prefix); those that accept a peer's broadcast or carry an epoch keep their scenario on the hidden dynamic_route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Implements moq-net follows announced instances: moq-net now owns the follow loop that #5700 hand-rolled in moq-ffi and moq-c (decision 5 there).
Changes
origin::Consumer::announced_broadcast(path, epoch)returns anorigin::AnnouncedBroadcast. Itsavailable()(andpoll_available()) hands out each publisher instance serving the path: the first once announced, then each one that takes over, or that returns after an end. It is the Rust form of JSrequest(path, { announced: true }). It settles the three cases the bindings each handled:Endforgets the last instance, so the same instance returning after a gap is handed out again.broadcast::WeakConsumer, so it never keeps a front from retiring once the caller lets go.Restartis skipped when it is the front handed out last.announced_broadcast(path, epoch)resolves only that instance.Routing(behindrouted_broadcast) gained a private epoch, so a pinned wait parks while another instance serves the path, as a pinnedrequest_broadcastrefuses it.MoqAnnouncedBroadcast::available()and moq-cmoq_origin_announced_broadcastdrop their loops and call it. moq-c's now-unusedConsume::holdsgoes too.doc/lib/rs/moq-net.mdpoints atannounced_broadcast.As the quest decided, this registers no discovery interest and has no blind fallback. Lazy discovery owns the first.
Public API and wire impact
origin::Consumer::announced_broadcast,origin::AnnouncedBroadcastwithpoll_availableandavailable(async feature).available()keeps its signature; OBS keeps calling it.Tests
announced_broadcast_*tests inrs/moq-ffi/src/test.rsand theconsume_announced_*tests inrs/moq-c/src/test.rs.rs/moq-net/src/model/follow.rs, onmoq_clocksimulated time. Each fails when its fix is reverted:announced_hands_out_the_instance_again_after_an_end: fails if an end keeps the last instance.announced_hands_out_a_dropped_takeover_again: fails if the last instance is held strongly. The dropped front never retires.announced_hands_out_a_held_takeover_once: fails without the skip of the front handed out last.announced_hands_out_a_gap_while_resolving_once: an end and a start while resolving hand the newcomer out once.announced_pinned_refuses_another_instance: mirrors the JSan epoch-pinned announced request refuses another instance. Fails if the resolution drops the pin.just checkandjust test interop --allpass locally on the merge with main (2026-10-20). The firstjust checkrun hitexport::redundant_importers_switch_through_bufferbloat_on_lite_07, a known main flake tracked by quest/m1/test-flakes-2/redundant-failover-drift.md in moq-cli, which this PR does not touch. A rerun passed all 7763 tests.Decisions
The quest left the Rust shape to this PR. The maintainer confirmed all three as implemented (comment).
origin::Consumer::announced_broadcast(path, epoch) -> Result<origin::AnnouncedBroadcast, Error>, withavailable()/poll_available(). It joins therequest_broadcast/routed_broadcastfamily, and its names match moq-ffi'sannounced_broadcast/MoqAnnouncedBroadcast::available()one to one, so the bindings stay thin.request_broadcast(path, request::Options { announced, epoch }). The return type would then change with the option, or every request would get a long-lived handle with a changingactive()broadcast. That breaks today's one-shotRequesting.next()/poll_next()likeannounce::ConsumerandFollow, or a role name such asorigin::Following. That is more idiomatic Rust but no longer mirrors the bindings.activereadsundefinedwhile another epoch wins.Unroutableonce another instance wins. That is louder, but an epoch that returns after a failover gap would then need a new request.Weak<MoqBroadcastConsumer>, or the moq-c id). moq-net can only see the front, so it remembers aWeakConsumer, which is live while the front is. The difference is narrow. Say a takeover resolves ahead of its heldRestart, and the caller drops its handle while another reader keeps that front up, or the front lingers after reads. That caller then waits for the next change instead of getting the same front again.Suggested follow-ups
announced_broadcast.moqsrc(rs/moq-gst/src/source/imp.rs,follow_path) andmoq play(rs/moq-cli/src/play/media.rs) still drivefollow()by hand and resolve on each start, without the takeover-once and gap handling. A quest could move both ontoannounced_broadcast.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code