A relay answers a FETCH with not found right after its serving route fails over, though the origin still serves the group

Open
#10,326 2 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start by checking the relay fetch and failover fixes linked in the issue (#10030, #10092, #10102, and #10072), then trace route selection and FETCH handling in the relay and moq-net. The issue suggests a moq-net integration test with two routes to one broadcast: fail over after a group is partly delivered or a track finishes, then verify FETCH succeeds and the reader receives the end. No standalone reproduction or source file is identified.

Written by the indexing model from the issue text.

Description

quest
What we see

A four-relay mesh: publisher-side relay A, transits T1 and T2 that each dial both A and B, and subscriber-side relay B. Every link runs through its own moq-shaper (10 ms ±3 ms gaussian delay, 1% loss each way, FIFO). A load client publishes to A and subscribes at B over lite. T2 is SIGKILLed while it carries B's route for the load's broadcasts, so B only learns of the death at its 10 s idle timeout and then moves each track to T1. The publisher keeps each finished track's producer for 15 s before it withdraws the broadcast.

Seen on moq 62c0ec81fa (moq-relay 0.17.2, moq-net 0.3.10), in two shapes, both around a track that finishes, or a group that was in flight, as T2 dies:

  1. A FETCH at B returns not found though A still serves the group. A lossless track's group 360 was sent about 1 s before the kill and never finished arriving through T2. When B's T2 session ended, the group's read failed at the subscriber, which FETCHed it from B about 0.25 s later. B answered not found within a few milliseconds. A was still lingering with the finished producer (the next generation of that broadcast appeared 14.5 s later), so the group was there to serve through T1. Once in 10 replays of the same seed.

    B 06:47:36.568142Z WARN conn{id=1 ...}: moq_net::lite::session: session error err=no error   # T2's session, idle timeout
    B 06:47:36.568714Z WARN conn{id=1 ...}: moq_net::lite::subscriber: subscribe error broadcast=<root>/a/chat/5/0 track=chat err=no error
    client 06:47:36.652665Z end heard for a/chat/5/0 at 455   # the end arrives through T1
    B 06:47:36.804030Z WARN conn{id=4 ...}: moq_net::lite::publisher: fetch error broadcast=<root>/a/chat/5/0 track=chat err=not found
    client 06:47:36.810390Z FETCH failed: not found broadcast=a/chat/5/0 track="chat" sequence=360
    
  2. A subscriber's track ends without its declared end. Once, in a scheduled run under heavier host load, one of the subscriber's media tracks (max_age 2 s, Live start with max: 2s, ascending) ended at B without a declared end or aborted, though its publisher finished every track and lingered. That run kept no relay logs, so we can't say which track. With the same seed, the publisher finishes two tracks about 1.5 s after T2 dies. In 9 replays, the subscriber always heard both ends, but only at B's failover, about 8 s after the finish, instead of promptly.

Questions
  • Main has several relay fetch and failover fixes newer than 62c0ec81fa: https://github.com/moq-dev/moq/pull/10030, https://github.com/moq-dev/moq/pull/10092, https://github.com/moq-dev/moq/pull/10102 and https://github.com/moq-dev/moq/pull/10072. Does any of them cover a FETCH at a relay whose serving route just failed over (1)? If not, the FETCH should go to the new serving route rather than answer not found.
  • For (2): when a track finishes while its relay's serving route is silently dead, is the end guaranteed to reach readers once the track fails over, as long as the origin still holds the finished track? The case that would lose it is a failover that lands after the origin withdrew. Then the relay has no route left that knows the end, and the track ends without it. Is that expected, or should the relay keep the end it can still learn? Route health (quest/m3/route-health) would shrink the window, but it wouldn't close it.
Reproducing

There's no standalone reproduction yet. A lower-layer one would be a moq-net integration test with two routes to one broadcast: finish the track (or leave a group half-delivered) just after the serving route goes silent, fail the route over, and check that the reader gets the end and that a FETCH of the group succeeds through the new route.

(Written by Claude Opus 5.5)

Dominant language
Rust
Stars
1.6k
Forks
251
Avg merge
10h 10m
Merged PRs (30d)
822

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from moq-dev/moq

All issues in moq-dev/moq

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.