Skip to content

fix(net): a live join takes the answer its cache ceiling capped - #9531

Merged
moq-bot[bot] merged 1 commit into
mainfrom
fix/live-join-ceiling
Nov 24, 2026
Merged

moq-bot[bot] merged 1 commit into
mainfrom
fix/live-join-ceiling

Conversation

@kixelated

@kixelated kixelated commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A relay copy asks its upstream for each reader's live join with the join's max capped by the copy's cache ceiling (broadcast::Info::cache_duration, clamp_combined). It then records the upstream's answer under that capped budget. TrackState::join_answer places a reader only by an answer whose budget is at least the reader's own, and it compared the reader's uncapped budget.

So a reader asking more than the ceiling never took the answer. Nothing wider is ever asked, so it waited forever. A moq-transport subscriber hits this through any relay with a cache ceiling, because its SUBSCRIBE becomes a live join with no limit (live_join). The relay answers SUBSCRIBE_OK, but a group that reached the copy before its SUBSCRIBE_START never reaches the subscriber. A sparse track such as a catalog then never delivers anything. Over a real network, the second relay's subscriber got nothing in about two runs of three.

The relay simulator sets no cache ceiling (sim::Net::options), so it never reached this path.

Approach

Cap the reader's budget by the same ceiling before comparing it with the answer's budget, so the reader is judged by what its copy actually asked. Without a ceiling, nothing changes: a narrower answer still places only the readers within it.

The test is at the model layer, where the bug is. A copy with a 30s ceiling and a reader with no limit gets a group whose stream lands before the answer, and must read it. It fails on main and passes here. The other cases pin that an answer narrower than a reader's budget still places nothing when no ceiling capped the ask.

Impact

  • No public API or wire change. A live join wider than the relay's cache ceiling is now placed by its upstream's answer instead of waiting forever.
  • js/net has no cache ceiling on its aggregate demand, so its joinAnswer mirror needs no change.

Validation

  • cargo test -p moq-net --features async: all pass, including the new a_live_join_takes_the_answer_its_cache_ceiling_capped. It fails on main with left: [] right: [3513] for ceiling=Some(30s) max=None.
  • just check passes.
  • Real surface: a staging fleet of 7 relays with a 30s cache ceiling, deployed with this commit. A moq-transport-18 or -22 subscriber on one relay, reading a publisher on another relay over the mesh, got 0 frames before this change in about two runs of three, both wires alike. With it, the staging smoke decodes 300 frames on both wires.
  • The same smoke's other cross-relay failures on this pin persist with this change, so they have another cause.

Alternatives

  • Have the copy ask the reader's full budget upstream. The ceiling caps the ask because a group older than the cache keeps cannot be produced, so asking wider asks for nothing more.
  • Leave the moq-transport live join at no limit and cap it there. Any reader wider than a relay's ceiling hits the same wait, so the fix belongs where the answer is judged.

Follow-ups

  • The relay simulator runs with no cache ceiling, so it misses ceiling-dependent paths like this one. Giving sim::Net a production-like ceiling is worth a separate look.

Caused by

  • moq-dev/moq#9316: placed a live join only by an answer under a budget at least the reader's, comparing the uncapped budget with an answer recorded under the copy's ceiling-capped ask (found by check).

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

A relay copy asks its upstream for a reader's live join capped by its cache
ceiling, and records the answer under that cap. A reader asking more, such as
an IETF subscriber's join with no limit, then never took the answer and waited
forever. Judge the reader's budget capped the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 24, 2026 11:52
@pullfrog

pullfrog Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

No configured credential can serve this run. Your Claude subscription has hit its usage limit, which resets at 2026-11-25 06:00 UTC. Re-trigger after it resets, or add an API key for this provider, which Pullfrog falls back to automatically.

The providers' responses
CLAUDE_CODE_OAUTH_TOKEN: 429: This request would exceed your account's rate limit. Please try again later.

Pick another model →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using claude-opus-5-5

@kixelated
kixelated enabled auto-merge November 24, 2026 11:53
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

TrackState::join_answer now clamps a reader’s budget to the track’s demand bound before it compares the budget with a stored upstream answer. The documentation describes this limit. An async test checks requested budgets and reader placement with and without a cache ceiling.

Merge Risk: Minimal · up to 5dab9

Live joins on a relay with a cache ceiling now take an upstream answer that was recorded under the capped ask, instead of waiting indefinitely. The narrowest-budget recording is preserved, so readers are not placed on answers that could miss groups they want. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: a live join now takes the upstream answer that its cache ceiling capped. The raw summary says join_answer now clamps the reader's budget to the demand bound before the comp…
Description check Passed The description states the problem, the approach, validation steps, impact, alternatives, and follow-ups. All of them concern the join_answer matching change and the cache ceiling path, which matches …
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.
Full details: Title check

Explanation

The title names the change: a live join now takes the upstream answer that its cache ceiling capped. The raw summary says join_answer now clamps the reader's budget to the demand bound before the comparison, which matches the title. The title is 63 characters, short and single-sentence, and avoids vague terms. The wording is slightly dense but specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description states the problem, the approach, validation steps, impact, alternatives, and follow-ups. All of them concern the join_answer matching change and the cache ceiling path, which matches the changeset. It is well related to the change.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

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: de309beb-f65c-43c7-8a68-fa3ab29e8cd0
Commits

Reviewing files that changed from the base of the PR and between 35e6841 and 5dab973.

Files selected for processing: 1

  • rs/moq-net/src/model/track.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

@moq-bot
moq-bot Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit cc50db3 Nov 24, 2026
8 of 9 checks passed
@moq-bot
moq-bot Bot deleted the fix/live-join-ceiling branch November 24, 2026 16:50
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