Skip to content

fix(moq-net): reject incompatible copies during failover - #3521

Merged
kixelated merged 5 commits into
mainfrom
quest/m0/resume-info-newest
Sep 10, 2026
Merged

kixelated merged 5 commits into
mainfrom
quest/m0/resume-info-newest

Conversation

@kixelated

@kixelated kixelated commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Failover routes must carry copies of the same broadcast. Previously the dispatcher admitted tracks with different immutable metadata, allowing a subscriber to interpret replacement frames using the predecessor's timescale.
  • Validate timescale, retention window, publisher priority, and group ordering before splicing a source. Refuse incompatible sources with Unsupported and keep compatible routes eligible.
  • Retain the established metadata for the broadcast's lifetime, including idle release and reopening an aborted track.
  • Regression coverage exercises incompatible sources, cached predecessor groups, established and new subscribers, FETCH, and reopening after refusal. Document the failover contract and complete quest/m0/resume-info-newest.md.

Public API

None. All added state and validation are private.

Wire

No format changes. Incompatible failover sources are refused using the existing Unsupported error.

(written by GPT-6)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-10T16:00:19.281129Z 0840df9 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8e4a1e00-3bf0-457b-9860-111b906bfca8

📥 Commits

Reviewing files that changed from the base of the PR and between 64ccc33 and 0840df9.

📒 Files selected for processing (1)
  • quest/m0/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • quest/m0/README.md

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

The origin front now records immutable track metadata for each track name. During source splicing, incompatible metadata is rejected with Error::Unsupported. Tests cover failover, idle release, and standby refusal cases. Relay documentation now defines failover compatibility requirements. The related quest entry and document were removed.

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 0840d

The change rejects incompatible failover sources while keeping compatible routes eligible, with regression coverage described for the affected behaviors. No concrete merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: rejecting incompatible copies during moq-net failover.
Description check ✅ Passed The description accurately covers the failover validation, metadata retention, regression coverage, documentation, and unchanged public API and wire format.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 3 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch quest/m0/resume-info-newest

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

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c7fc9797e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread rs/moq-net/src/model/resume.rs Resolved
@kixelated
kixelated force-pushed the quest/m0/resume-info-newest branch from 7c7fc97 to e350980 Compare September 9, 2026 20:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e350980842

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread rs/moq-net/src/model/resume.rs Resolved
Comment thread rs/moq-net/src/model/resume.rs Resolved
kixelated and others added 4 commits September 9, 2026 13:55
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`resume::Consumer::poll_info` resolved `track::Info` from segment zero while
every data read routes to the newest segment. When a track is re-served on a
live path (a source dies and a standby takes over, or a publisher reconnects),
those are different generations, so a subscriber was handed the predecessor's
metadata alongside the successor's frames.

`timescale` is the damaging field. On moq-lite the model converts each frame
timestamp into its own track's timescale and the raw value goes straight onto
the wire, so TRACK_INFO advertising the predecessor's scale silently rescales
every frame rather than failing. `priority` and `latency_max` were wrong but
survivable.

Resolve from the newest segment instead, and park on the segment list while its
info is still pending so a takeover that supersedes it re-resolves against the
successor rather than answering with a generation nobody will read.

This is the Rust half of the defect #3422 fixed in `js/net`. No wire or API
change, so no draft moves.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
Preserve immutable metadata for each broadcast track and reject incompatible routes before splicing. Keep healthy copies eligible and retain the contract across idle release and reopening.

Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated
kixelated force-pushed the quest/m0/resume-info-newest branch from e350980 to 64ccc33 Compare September 9, 2026 21:52
@kixelated kixelated changed the title fix(moq-net): resolve a spliced track's info from the newest segment fix(moq-net): reject incompatible copies during failover Sep 9, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64ccc3317e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment on lines +2410 to +2412
_ => match state.write() {
Ok(mut state) => state.accept_track_info(&name, info).map(|()| track),
Err(_) => Err(Error::Dropped),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Revalidate the route before caching its metadata

When a better route attaches while the previous route's TRACK_INFO is pending, both the query and source-table poll can become ready, but the wait closure checks the query first and reaches this write without confirming that serve_route(skip) is still id. This can cache the superseded route's metadata, causing the preferred route to be rejected as Unsupported if its properties differ and leaving the track on the obsolete route or aborting when that route disappears. Fresh evidence beyond the earlier resume race is this new FrontState cache write after the table-aware wait; revalidate the selected route under the write lock before accepting its info. rs/moq-net/CLAUDE.mdL10-L10

Useful? React with 👍 / 👎.

@kixelated
kixelated enabled auto-merge (squash) September 9, 2026 21:57
@kixelated
kixelated merged commit f545736 into main Sep 10, 2026
4 checks passed
@kixelated
kixelated deleted the quest/m0/resume-info-newest branch September 10, 2026 16:02
@moq-bot moq-bot Bot mentioned this pull request Sep 10, 2026
kixelated added a commit that referenced this pull request Sep 12, 2026
Resolved by behavior, keeping both sides' fixes:

- moq-net ietf publisher: main's joining FETCH with its saved object prefix
  (#3562) rebuilt on dev's shapes; its two refusal codes map to DOES_NOT_EXIST
  until the registry gains them (quest/m2/ietf-leftovers.md)
- moq-net origin: main's incompatible-copy refusal during failover (#3521)
  ported to dev's source table (FrontState::track_info, checked on Splice)
- draft-21 (#3574): the moq-tokio client/server/websocket arms, the CLI
  version choice lists, the IETF error registry gates and test lists, and
  js/net accept.ts, which the auto-merge had left referencing a removed local
- moq-video/moq-audio: main's Start::Latest and drain fixes (#3565, #3568)
  expressed with dev's max_age; ported tests carry an age budget
- quest/: dev's tree with main's decisions since the merge base (#3576,
  #3619, #3623, #3604), quests finished on either side deleted

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@moq-bot moq-bot Bot mentioned this pull request Sep 14, 2026
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