Skip to content

fix(net): keep track::Fetching unwind safe - #4758

Merged
kixelated merged 1 commit into
mainfrom
fix/fetching-unwind-safe
Oct 3, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/fetching-unwind-safe

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

#4691 made track::Fetching hold a cached-hit group::Consumer. That consumer carries an Arc<dyn group::Expiry>, and the crate-private Expiry trait is not RefUnwindSafe, so Fetching lost UnwindSafe and RefUnwindSafe. cargo-semver-checks flags that as breaking, which is why release-plz #4596 bumps moq-net to 0.4.0 while its public dependents (moq-tokio, hang, ...) get patch bumps: downstream users would break on a patch update.

Approach

Add UnwindSafe + RefUnwindSafe supertraits to the crate-private group::Expiry (its one implementor, GroupExpiry, already satisfies them), matching the moq-audio Backend pattern. A unit test statically asserts Fetching and group::Consumer are unwind safe so this can't regress silently.

A backport to release follows so #4596 regenerates with a 0.3.x moq-net bump.

Impact

  • track::Fetching regains UnwindSafe and RefUnwindSafe (as in moq-net 0.3.8).
  • group::Consumer gains UnwindSafe and RefUnwindSafe (additive).
  • No wire change.

Alternatives

  • Wrap the held hit in AssertUnwindSafe inside Fetching: fixes only the symptom; group::Consumer stays !UnwindSafe for no real reason.
  • Accept moq-net 0.4.0 on release: requires minor bumps on every public dependent.

Follow-ups

  • moq-relay::drills relay_killed_mid_group_aborts_then_resumes::impaired flaked locally once with EADDRINUSE when restarting the relay on the same UDP port under parallel test load (passes in isolation). Unrelated to this change.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

The cached-hit group consumer added to Fetching in #4691 carries an
Arc<dyn group::Expiry>, which is not RefUnwindSafe, so Fetching dropped
UnwindSafe and RefUnwindSafe: a semver break that forced moq-net 0.4.0.
Require unwind safety on the crate-private Expiry trait and assert it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review October 3, 2026 17:42
@coderabbitai

coderabbitai Bot commented Oct 3, 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 17 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
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e2148507-e7f7-4b10-a1a9-7168b190243e
📥 Commits

Reviewing files that changed from the base of the PR and between 1956381 and c5c7180.

📒 Files selected for processing (2)
  • rs/moq-net/src/model/group.rs
  • rs/moq-net/src/model/track.rs
  • Autopilot · 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

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

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Automated review by review (OpenAI)

Reviewed c5c7180. No actionable bugs found.

Direction: the private Expiry supertrait bounds in rs/moq-net/src/model/group.rs:1135 fix the trait-object boundary directly, letting the compiler enforce unwind safety instead of asserting it with AssertUnwindSafe. The compile-time assertions in rs/moq-net/src/model/track.rs:8087-8091 protect both public handle types. This is a small, justified compatibility fix with no runtime or wire changes.

Verification limits: static review of the patch and surrounding Consumer, Fetching, and GroupExpiry code only; I did not run Rust tests or cargo-semver-checks. The release-branch backport and regenerated #4596 version plan still need separate verification.

(Written by OpenAI)

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merging: CI green, automated review found no issues. Fix is the supertrait bound on the private group::Expiry (chosen over AssertUnwindSafe on the held hit, which would leave group::Consumer needlessly !UnwindSafe). Backport to release is #4759, so release-plz #4596 can regenerate with a 0.3.x moq-net bump.

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit 30f7345 into main Oct 3, 2026
7 checks passed
@kixelated
kixelated deleted the fix/fetching-unwind-safe branch October 3, 2026 18:23
kixelated added a commit that referenced this pull request Oct 3, 2026
fix(net): keep track::Fetching unwind safe (backport #4758)
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