Repository navigation
fix(http1): drain client dispatch receiver on connection shutdown - #4222
Merged
seanmonstar merged 1 commit intoOct 9, 2026
Merged
Conversation
Keep the closed dispatch receiver alive until all in-progress sends have published and canceled their callbacks Preserve the connection result across drain polls and keep upgrade handoffs unchanged Closes hyperium#4202
This was referenced Oct 9, 2026
akasakariko
added a commit
to akasakariko/akasakariko
that referenced
this pull request
Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4202
Summary
On HTTP/1 shutdown, tasks reserving channel capacity before close could publish afterward and leave envelopes stranded; this fix closes and asynchronously drains the dispatch receiver until
Ready(None), canceling unsent requests with original requests recoverable while callers holdSendRequestorhyper-utilChanges:
src/proto/h1/dispatch.rsandsrc/client/dispatch.rs: close and drain dispatch receiver on shutdown untilReady(None)Verification
Local verification passed (GitHub CI not started):
cargo test --features full --lib client_close_drains_pending_requests: 3 pass with fix, 3 fail on original code; passes on Tokio 1.38.2cargo test --features full: 315 passed, 10 ignoredrustfmt --check --edition 2021 $(git ls-files '*.rs')andgit diff --checkpasscargo clippy --features full -- -D warnings: exits 0 with 3 pre-existing manifest warningscargo hackdepth-2 powerset passes across 66 configurations including tracingcargo semver-checksagainst origin/master: 223 checks passRUSTFLAGS='--cfg hyper_unstable_ffi' cargo test --features client,http1,http2,ffi --lib: 99 passed, 6 ignored