Skip to content

One broadcast's failure never ends export archive for the others - #9040

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/precut-fixes/archive-isolate
Nov 18, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/precut-fixes/archive-isolate

Conversation

@kixelated

@kixelated kixelated commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

moq export archive now records every broadcast independently. A recording that fails (a track re-added with another priority or timescale, reused group sequences, a listing error) is logged at warn and dropped, and a path whose follower fails (a handler refuses it) is dropped too. Every other broadcast keeps recording. Only the origin failing (announcements end) or a task panicking, which is a bug and stays loud, ends the export. A failed instance that is announced anew records again, since Running::done still runs.

The quest asked to check whether an ordinary publisher disconnect surfaces as a recording error. It does not: a dropped session closes cleanly, and a track aborted with an error code is recorded as an end by moq_archive::Producer::run, which returns Ok (rs/moq-archive/src/producer/track.rs:255-269). an_aborted_track_leaves_the_others_recording pins that the export keeps running over such a publisher; it passes on the old code too, since neither case reaches the failure branch (probed: no recording ended on that test).

Removes the quest file (archive-isolate), which this PR finishes. Updates doc/bin/cli.md.

Public API

CLI behavior only: a failed recording no longer exits moq export archive. No Rust, JS, or binding API; no wire change. No !.

Caused by

  • moq-dev/moq#4034 - added export archive with one failure ending every recording (found by audit)

Validation

  • cargo test -p moq-cli archive: 10 pass. Two new tests (a_failed_recording_leaves_the_others_recording, a_refused_path_leaves_the_others_recording) fail with the old ? propagation restored and pass with the fix; a_failed_recording... stores a mismatched timescale .info for one broadcast, then checks a second and a later third both write .end and the export task is still running. The old refused-path test, which asserted the export fails, is replaced.
  • cargo clippy -p moq-cli --all-targets -D warnings and cargo fmt clean; quest check ok.
  • Not run: the built moq binary against a live relay; the tests drive export itself over a real origin and a file store.

Models

Size: S
Implementer: Claude Code, claude-sonnet-5-5, unknown effort (arm B)
Implementer: Claude Code, claude-sonnet-5-5, unknown effort (iterate, XS, arm B)

Review

Rewritten by quest review after each round.

  • Head: ad78a72

  • Base: origin/main at 61f8956

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1ec36-1577-79a0-8a74-6a4d50b51cd6, round 2

  • Score: 9/10, The incremental change accurately renames and documents the aborted-track test without changing behavior; no actionable defects were found, and builds and tests were not run as instructed.

  • Rounds: 2; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 2 commits November 17, 2026 17:08
…thers

A recording that fails, or a path a handler refuses, is logged and
dropped; every other broadcast keeps recording. Only the origin failing
or a task panicking ends the export.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 18, 2026 01:13
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 34ef7e1c-ba7f-4ead-8ae2-ec12f56f2936
Commits

Reviewing files that changed from the base of the PR and between 0c14c87 and ad78a72.

Files selected for processing: 3

  • doc/bin/cli.md
  • quest/m1/precut-fixes/archive-isolate.md
  • rs/moq-cli/src/archive.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@kixelated

Copy link
Copy Markdown
Collaborator Author

Maintainer pick: /quest-merge.

(Written by Claude Opus 5.5 with high)

@kixelated
kixelated enabled auto-merge November 18, 2026 01:14

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one design gap and a stale test comment, both minor.

Approach: sound — the isolation belongs at the export's own task boundary, where each path and each recording is already its own task, so a warn in the select loop beats teaching moq-archive to classify its errors.

Reviewed changes

  • Recording isolation — recordings.join_next() logs a failed recording instead of propagating it, and still calls running.done, so an instance re-announced during its recording records again; a panicked task still ends the export.
  • Follower isolation — a follow failure now logs and drops that path instead of ending the export; origin close still returns quietly and a follower panic still fails.
  • Docs — doc/bin/cli.md and the export/follow doc comments state the log-and-drop behavior, and the finished quest file is removed.
  • Tests — three scenario tests, and the old a_refused_path_fails_the_export is replaced by its inverse.

ℹ️ A path dropped on a refusal is never followed again

A recording that fails is retried once the instance is announced anew, but a path whose follower fails has no equivalent: Following is designed to recover from a refusal by itself, and discarding it throws that away. For a long-lived archive this means one transient refusal silently stops that broadcast from ever being recorded again while it stays announced.

Technical details
# No retry for a path (or recording) dropped by its first error

## Affected sites

- `rs/moq-cli/src/archive.rs:112-114` — the follower's `Err` warns and the path is dropped; nothing restarts it. `Following::poll_available` already implements the retry (`rs/moq-net/src/model/follow.rs:296-299`): after a refusal "the next call then waits for the serving route to change ... instead of asking the refusing route again", so continuing the loop on a non-`Closed` error would wait and resume without spinning.
- `rs/moq-cli/src/archive.rs:104-106` — `Available` is ignored, and a takeover that keeps the path present is a `Restart`/availability event rather than a new `Present` (`rs/moq-net/src/model/announced.rs:30-34`, `61-77`), so only `Absent`/`Offline` followed by `Present` can revive the path.
- `rs/moq-cli/src/archive.rs:130-132` — `running.done` removes the instance after a failure, and the follower re-sends it only when the broadcast changes, so a transient `record` failure (a request refusal, or a store failure surfaced by `moq_archive::Producer::run`) also goes unretried while that instance stays announced.

## Required outcome

- Decide whether the archive may silently miss a broadcast for the rest of the process after one transient error.
- If not, the smallest change is to keep `follow`'s loop going on a non-`Closed` error; covering a transient recording failure would need its own bounded retry.

## Open questions for the human

- Is "dropped" meant to last until the path cycles absent→present, or only until the serving route changes again?

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash | 𝕏

Comment thread rs/moq-cli/src/archive.rs Resolved
@moq-bot
moq-bot Bot disabled auto-merge November 18, 2026 01:29
@moq-bot

moq-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

quest land watch: ended this pull request's pick, disarming its auto-merge, since its head 95ed1e4 is held by finding by pullfrog[bot]: This test passes against the pre-fix code, and the reason is worth pinning here: track.abort reaches the archive as an (#9040 (comment)). Push a fix, or answer each by a thread reply or a comment linking its review or decision, then land it again.

(written by quest land watch)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

This re-review covers only the single commit pushed since the last review (ad78a72), which touches a test's name and its doc comment and nothing else.

  • Renamed the abort test — a_dropped_publisher_leaves_the_others_recording is now an_aborted_track_leaves_the_others_recording, naming what the test actually exercises.
  • Corrected its doc comment — it now states that an aborted track is recorded as an end and run() returns Ok, so the test never reaches the new failure isolation. Confirmed against rs/moq-archive/src/producer/track.rs:255-272: Event::Next(Err(err)) sets failed, error(&err) builds the end, and run() returns Ok(end), so the changed if let Err branch is not exercised. This supersedes the stale claim that a dropped session does not close cleanly.

No behavior change; the earlier inline concern is addressed and resolved.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 9703de4 Nov 18, 2026
7 checks passed
@kixelated
kixelated deleted the quest/m1/precut-fixes/archive-isolate branch November 18, 2026 02:09
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