Skip to content

fix(http2): fix race, drain client dispatch reciever - #4242

Open
mingley wants to merge 1 commit into
hyperium:masterfrom
mingley:mingley/h2-drain-dispatch-on-shutdown
Open

mingley wants to merge 1 commit into
hyperium:masterfrom
mingley:mingley/h2-drain-dispatch-on-shutdown

Conversation

@mingley

@mingley mingley commented Oct 22, 2026 •

Copy link
Copy Markdown

What

Fix

Testing

  • cargo test,clippy,fmt

  • local reproduction with a 300ms sleep between reserve and publish in Tokio's send.

    • Before: hangs
    • After: Canceled with "connection closed".
  • The description, docs, and comments (words meant for humans) are written by a human, not by an LLM. (https://seanmonstar.com/micro/20260729-i-want-your-own-words/)

Comment thread src/client/dispatch.rs
}
}

#[cfg(feature = "http1")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are we removing this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

#4222 added poll_close while fixing the same h1 race condition from #4202.

It was gated to h1 because h1 was it's only caller.

this PR does the same race fix for h2.

ready!(self.req_rx.poll_close(cx));

ClientTask calls poll_close, and poll_close calls close.

If we keep these h1 gates, an "h2 only" build fails.

This branch has not been deployed

No deployments
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.

2 participants