Skip to content

relay: a publisher replacing a killed one is sent the old session's subscriptions before it has published, and moq import ts exits with "rendition is not published" #4945

Closed

Description

@t0ms

On main at edd671fff, when a moq import ts publisher is SIGKILLed and a new one starts under the same broadcast name, the relay sends the new publisher the old session's subscriptions within 2 ms of it connecting, before it has published anything. About 0.2 s later the new publisher exits with Error: rendition is not published. A subscriber that is lingering then has nothing to resume onto until the next publisher after that. On 83ce47fe3, before #4741, the same rig resumed onto the replacement in 3 of 3 runs.

Rig

All on one host, loopback, one relay (moq-relay with a local config, --quic-gso=false). One subscriber, moq export ts --linger 60s. Three publisher sessions in turn under one broadcast name, each tsp -I file <clip> -P regulate --pcr-synchronous -P until --seconds 15 | moq import ts. The first two are SIGKILLed 5 s before their clip ends, and each next session starts 3 s after the kill. The clip is a 9.95 Mb/s broadcast capture: H.264, MP2, AC-3, teletext and three data PIDs.

What happens on edd671fff (3 runs)

Runs 1 and 2: the replacement publisher exits. It connects 3.3 s after the kill. In the same 2 ms it receives track info for every track of the old broadcast, subscribe for the video, the five .ts tracks and catalog.json, and a fetch for 0.avc3 group 7 from frame 30. The fetch and four of the track infos return not found. 0.2 s later two of the subscriptions error not found, every track producer is dropped, and the process exits:

20:42:19.059204Z  INFO moq_tokio::client: connected version=moq-lite-06 transport=webtransport
20:42:19.060366Z  INFO moq_net::lite::publisher: track info started broadcast=lin-52565.hang track=0.avc3 ...
   (track info for every track, then subscribed started for 0.avc3, 1.ts–5.ts and catalog.json)
20:42:19.061079Z  INFO moq_net::lite::publisher: fetch started ... track: "0.avc3", priority: 0, group: 7, start_frame: 30, end_frame: None }
20:42:19.061123Z  WARN moq_net::lite::publisher: fetch error broadcast=lin-52565.hang track=0.avc3 err=not found
20:42:19.264673Z  WARN moq_net::lite::publisher: subscribed error broadcast=lin-52565.hang track=5.ts err=not found
20:42:19.264933Z  WARN moq_net::lite::publisher: subscribed error broadcast=lin-52565.hang track=4.ts err=not found
20:42:19.264987Z  WARN moq_net::model::track: track::Producer dropped without finish() or abort() track=catalog.json
20:42:19.265032Z  WARN moq_net::lite::publisher: subscribed error broadcast=lin-52565.hang track=catalog.json err=not found
20:42:19.265640Z  INFO moq_net::lite::session: session terminated
Error: rendition is not published

The subscriber notices the kill 12.7 s and 10.7 s after it, with broadcast ended, waiting for it to return err=moq: dropped in run 1 and err=moq: internal error in run 2. It then resumes onto the third session, so the second publisher is lost and the outage runs from the first kill to the third session.

Run 3: no resume at all. Here the second publisher survived until its own kill. The export's output stops about 13 s in (85,744 packets). Apart from the TDT's SI track failing not found at 20:45:56, nothing is logged for the next 30 s:

20:46:18.113272Z  WARN moq_net::lite::subscriber: subscribe end below a received group track=catalog.json group=22 err=protocol violation
20:46:18.113368Z  WARN moq::subscribe: broadcast ended, waiting for it to return err=json: protocol violation linger=60s
20:47:18.114710Z  INFO moq::subscribe: broadcast did not return linger=60s

The process exits 1. That reads like the new publisher's catalog group numbers restarting below the old session's, but I haven't traced it.

Before #4741

On 83ce47fe3 the same rig, 3 runs: the kill is noticed about 10 s after it (err=moq: unroutable / internal error), the export resumes onto the live replacement within 2 ms, the replacement publisher logs no error, and the subscriber exits 0 after the last session. The PR #4645 head fe7cec106, which has main merged in, also shows rendition is not published on the replacement in 3 of 3 runs.

What I haven't located

Where the error comes from. Error::NotPublished is moq-mux's refusal to modify a rendition that isn't present, and the requests reach the importer before it has read its first PMT. Whether the relay should hold the old session's subscriptions until the new publisher announces the tracks, or the importer should tolerate requests for tracks it hasn't created yet, is reasoned from the logs, not traced. I can share the full relay, publisher and subscriber logs.

Activity

  1. added
    questBeing tracked/planned in a quest. See `quest/`
    on Oct 7, 2026
  2. added a commit that references this issue on Oct 7, 2026
  3. kixelated commented on Oct 8, 2026

    @kixelated
    Collaborator

    Closing: the 2026-10-08 quest audit deleted the catalog-early-demand quest that tracked this. The moq import ts detector that failed with "rendition is not published" was removed in #4915, and the relay half was fixed in #4942, so the regression test could not fail without reverting merged code. Reopen with a fresh repro if it recurs.

    (Written by Claude Opus 5.5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questBeing tracked/planned in a quest. See `quest/`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions