Skip to content

test(net): acknowledge upstream FINs on arrival in relay_upstream_close - #7066

Merged
kixelated merged 1 commit into
mainfrom
test/relay-close-acks-fins
Oct 29, 2026
Merged

kixelated merged 1 commit into
mainfrom
test/relay-close-acks-fins

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

relay_upstream_close checks that a relay ends a finished track cleanly downstream after the publisher's session closes. The mock transport acknowledged a FIN only once the relay read it, so the publisher's close could not drain until the relay already had every SUBSCRIBE FIN. QUIC acknowledges a FIN when it arrives, before the application reads it. So a draining close can finish, and the session can close, while the relay still has the FIN unread.

That is the race #6741 fixed, but the test only caught it on Lite03 and Lite04, through their tail grace. With #6741's poll_drain change reverted, Lite05 and Lite06 still passed. A real relay in that window ends a downstream subscription Unroutable after every frame arrived, instead of finishing it.

Approach

The publisher's transport acknowledges FINs on arrival (ack_fins), as QUIC does. With #6741's subscriber change reverted, the test now fails on every Lite version through 06:

assertion `left == right` failed: moq-lite-05 Close track0: result=Err(Stream(Unroutable))
assertion `left == right` failed: moq-lite-06 Close track0: result=Err(Stream(Unroutable))

It passes on main for every listed version, for both close and abort. The doc comments now say why the close drains before the relay reads.

Impact

  • None. Test only; no API or wire change.

Alternatives

  • A separate test for the Lite05/06 case. Rejected: it would repeat this test's setup, and the gap was only the mock's acknowledgement timing.

Follow-ups

  • None.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

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

coderabbitai Bot commented Oct 28, 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 9 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: 65b3f40b-4336-46ac-9719-a483349941cb
Commits

Reviewing files that changed from the base of the PR and between cdd0196 and 00d376a.

Files selected for processing: 1
  • rs/moq-net/tests/integration/relay_upstream_close.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

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-10-28T09:03:49.663963Z 00d376a PR opened
ℹ️ 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.

@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 commit: 00d376a

No actionable bugs found. The direction is sound: enabling ack_fins() on the publishing upstream transport before finishing the tracks removes the mock's read-before-ack dependency, exercising the unread-FIN/session-close race while preserving the existing frame-completeness and clean-end assertions. Reusing this test and the existing transport knob is simpler than adding a duplicate scenario; no production API or wire behavior changes.

Verification: inspected the changed test, connection harness, and mock FIN acknowledgment implementation on GitHub. Tests and the reported regression-revert experiment were not run independently.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary: no changes were needed. CI passed on 00d376ac9a158abf02718a2c8720e276ce071de8, the Codex review (thumbs up) and the automated review had no findings, the PR merges cleanly into main, and quest check passed. Landing this head with a squash.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit cb353ed Oct 29, 2026
10 checks passed
@kixelated
kixelated deleted the test/relay-close-acks-fins branch October 29, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant