Skip to content

fix(moq-net): a released group keeps its declared end - #9259

Open
kixelated wants to merge 1 commit into
mainfrom
fix/released-keeps-end
Open

kixelated wants to merge 1 commit into
mainfrom
fix/released-keeps-end

Conversation

@kixelated

@kixelated kixelated commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

A finished group keeps where it ends after its cache is released.

Bug

commit_abort turns Outcome::Finished(frames, end) into Outcome::Released(frames, err) when cache policy (Old, Timeout, Evicted) frees a finished group, dropping end. So group::Consumer::end returns None for a group that still finished whole:

  • A reader that drained every frame and asks for the end after the release loses it. Kixel's byte streams read a group finished at its declared end as FIN, and one without it as a reset, so a late read turns a clean FIN into a reset.
  • A lite-07 publisher serving such a group (buffer_group_end in lite/publisher.rs) skips GROUP_END when the release lands between its last frame and the end, so the subscriber's copy ends without its end.

Change

Outcome::Released carries the declared end (Released(usize, Option<u64>, Error)), and both end()s (the public group::Consumer::end and the crate's own) report it. A reader short of the last frame still gets the release error from its next read, as before.

Validation

  • Extended abort_after_finish_keeps_the_clean_end_for_a_drained_reader to finish with finish_at(1) and assert the drained reader's end() is Some(1) after abort(Error::Old). Reverting only the two end() arms fails it (left: None, right: Some(1)); with the fix it passes.
  • cargo test -p moq-net --all-features: all pass.
  • just check (in the dev shell): passed.

Caused by

  • moq-dev/moq#8638 - added the declared end to Outcome::Finished but discarded it on the move to Outcome::Released (found by reviewer)

Public API

No signature change. Behavior: group::Consumer::end now returns the declared end of a finished group after its cache is released, instead of None. No wire format change; a lite-07 publisher now sends GROUP_END for such a group where it used to omit it.

Follow-ups

None.

Models

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

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: 28953b3

  • Base: origin/main at 037c6f1

  • Risk: medium, Preserving finished-group end timestamps after cache release changes behavior consumers rely on and could affect their end-of-group handling, but keeps the API and wire format intact and is fully undone by a revert.

  • Classified: medium by Codex, gpt-6.1-sol, low effort, session 01a1fb95-2c0d-7933-a2fe-aa300876e176

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

  • Session: 01a1fb95-3c93-7ce0-b1f9-403aa69dfee4, round 1

  • Score: 9/10, The focused fix preserves the declared end after cache release without changing incomplete readers' error behavior and includes regression coverage, though tests were not run as instructed.

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

  • Findings: none

A finished group whose cache is released (Old, Timeout, Evicted) still
finished whole, but group::Consumer::end returned None once it was, so a
reader that drained every frame and asked after the release lost where
the group ends, and a lite-07 publisher serving it skipped GROUP_END.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 21, 2026 00:51
@coderabbitai

coderabbitai Bot commented Nov 21, 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 24 minutes.

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: 7a37bb37-3510-4c59-a4c0-63efeb91d19c
Commits

Reviewing files that changed from the base of the PR and between 037c6f1 and 28953b3.

Files selected for processing: 1

  • rs/moq-net/src/model/group.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

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

Approach: sound. The end is carried inside the existing Outcome::Released variant rather than added as a side field, so the lifecycle stays one enum and every end() reader picks it up without extra work.

Reviewed changes

This run reviewed the single commit, which keeps a finished group's declared end after cache policy releases it.

  • Outcome::Released carries the end: commit_abort now moves Finished(frames, end) into Released(frames, end, err) instead of dropping end.
  • Both end() accessors report it: the public group::Consumer::end and the crate's Handle::end now return the end for Released groups too. Reads are unchanged: a reader short of the last frame still gets the release error.
  • Downstream effect is consistent: the same group identity now reports the same end before and after release. This also covers paths the PR body doesn't mention: ietf/publisher.rs end_object now builds END_OF_GROUP for such groups, and model/track.rs own_end/ended_at see the end when they compute expiry bounds.
  • Regression test: abort_after_finish_keeps_the_clean_end_for_a_drained_reader now finishes with finish_at(1) and checks that end() returns Some(1) after abort(Error::Old).

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

This branch has not been deployed

No deployments
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