Skip to content

fix(tokio-quiche): wake idle listener when accept stream is dropped - #2798

Closed
codeandsolder wants to merge 1 commit into
cloudflare:masterfrom
codeandsolder:upstream-pr/tokio-listener-drop-wake-20261004
Closed

codeandsolder wants to merge 1 commit into
cloudflare:masterfrom
codeandsolder:upstream-pr/tokio-listener-drop-wake-20261004

Conversation

@codeandsolder

Copy link
Copy Markdown

Summary

Wake an idle tokio-quiche router when its accept stream is dropped so the listener socket/address is released promptly.

Problem

The router checks accept_sink.is_closed() when it is polled, but an otherwise idle router does not register a wakeup tied to the receiver being dropped. Dropping the accept stream can therefore leave the router task asleep while still holding the UDP socket, delaying teardown/rebind indefinitely until unrelated activity wakes it.

Change

Poll a cloned sender's closed() future alongside the router's normal work. That gives the task a wake source tied directly to receiver shutdown without changing the success path.

A regression test binds a listener, drops the accept-side streams while it is idle, and verifies the same address can be rebound promptly.

The shared Rust 1.98.1 validation run passed idle_listener_releases_socket_after_stream_drop; repository nightly formatting is clean.

@codeandsolder
codeandsolder requested a review from a team as a code owner October 4, 2026 21:07
@ghedo ghedo added type: bugfix Corrects defective behavior. area: tokio-quiche Changes related to tokio-quiche. labels Oct 5, 2026
@ghedo

ghedo commented Oct 5, 2026

Copy link
Copy Markdown
Member

Closing as a duplicate of #2763. Both use the same receiver-closed future to wake an idle listener when the accept stream is dropped, with equivalent teardown regression coverage.

@ghedo ghedo closed this Oct 5, 2026
@codeandsolder-git-wrangler
codeandsolder-git-wrangler Bot deleted the upstream-pr/tokio-listener-drop-wake-20261004 branch October 7, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tokio-quiche Changes related to tokio-quiche. type: bugfix Corrects defective behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants