Skip to content

fix(uring): close connections when the last session handle drops - #5748

Merged
kixelated merged 3 commits into
mainfrom
quest/m2/uring-drop-close
Oct 17, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m2/uring-drop-close

Conversation

@kixelated

@kixelated kixelated commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Dropping the last quic::web::Session left its connection alive because the QUIC driver and WebTransport capsule reader retain internal state. The regression observed a peer idle timeout instead of an application close.

Closes the quest quest/m2/uring-drop-close.md (deleted here).

Approach

Count public session handles separately and initiate the existing close path when the last drops. Raw sessions close directly; WebTransport retains its capsule and critical-stream handling. Explicit close codes remain authoritative (first close wins in both the driver and the WebTransport layer).

Impact

  • Public API: no new or changed exported items. Behavior: last-handle drop of quic::web::Session now initiates an application close with code 0 (reason dropped) in raw and WebTransport modes, matching the tokio backend's implicit close.
  • Wire: none.
  • A bare quic::Connection still needs an explicit close; its doc now points at web::Session for drop-closes. The worker must remain driven to send the close, as with explicit close.

Decisions

Iteration review (sub-agent, recommended options picked):

  • Scope: close on the last web::Session handle only, not on bare Connection. ✅ Keep as is (internal driver and capsule tasks hold Connection clones, so counting those would preserve the leak; the relay and benches always wrap in web::Session). Alternative: split internal handles from public Connection handles, a larger refactor with no current consumer.

Alternatives

Counting connection or WebTransport references would also count internal driver and capsule tasks, preserving the leak.

Validation

just check passed after merging main (660 tests, 6 skipped), including the raw-drop, WebTransport capsule, and explicit-close preservation regressions over real loopback QUIC. The unpatched raw-drop test failed with TimedOut.

Follow-ups

None. Maintainer decided no release backport; the fix ships with the next release.

(Written by GPT-6, updated by Claude Opus 5.5)

🤖 Generated with Claude Code

@kixelated
kixelated marked this pull request as ready for review October 17, 2026 04:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-17T04:17:46.160443Z 3010fbd Draft marked ready
ℹ️ 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 Oct 17, 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 11 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: bc7ad56b-8274-4c44-bcb0-4530e365c242
📥 Commits

Reviewing files that changed from the base of the PR and between 6ae07a8 and 3010fbd.

📒 Files selected for processing: 7
  • quest/m2/README.md
  • quest/m2/relay-io-uring-package.md
  • quest/m2/uring-drop-close.md
  • rs/moq-uring/src/quic/driver/connection.rs
  • rs/moq-uring/src/quic/web.rs
  • rs/moq-uring/tests/integration/endpoint.rs
  • rs/moq-uring/tests/integration/web.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.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary for head 3010fbd81122f42251224bd0b94e5e26e89c7e43:

  • Change: dropping the last quic::web::Session handle in moq-uring now initiates an application close (code 0, reason dropped) in raw and WebTransport modes; explicit close codes still win.
  • Decisions (maintainer): only web::Session closes on drop, a bare quic::Connection still needs an explicit close. No release backport.
  • Checks: CI green on the head; Codex reviewed the head with no findings. A local merge with current main (including Migrate network timing onto moq-clock #5681 and feat(net)!: let live announcements renew their auth #5695) was clean and cargo test -p moq-uring passed, so no new head was pushed; the merge queue re-tests against main.

Arming auto-merge pinned to this head.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit 9918ed5 Oct 17, 2026
14 checks passed
@kixelated
kixelated deleted the quest/m2/uring-drop-close branch October 17, 2026 14:28
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