feat(client): retire pooled HTTP/2 connections on keep-alive reuse timeout - #319
Open
jiahaoliang wants to merge 3 commits into
Open
feat(client): retire pooled HTTP/2 connections on keep-alive reuse timeout#319jiahaoliang wants to merge 3 commits into
jiahaoliang wants to merge 3 commits into
Conversation
…meout Bind each handshake to its own poison observer and preserve in-flight streams. Exercise replacement connections and recovery with controlled duplex IO. Depends on the companion Hyper API; leave release selection to follow-up.
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.
fix hyperium/hyper#4186
related to: hyperium/hyper#4187
This PR implements the hyper-util portion of the shared reuse-timeout proposal, tracked in the Hyper issue. It lets the legacy Client stop reusing an unresponsive H2 connection while preserving the existing keep-alive hard timeout for its active streams. It depends on the companion Hyper API PR.
It adds
http2_keep_alive_reuse_timeout(Option<Duration>), disabled by default. Each H2 handshake receives an observer holding only that connection'sPoisonPill. Hyper's soft-timeout notification poisons the entry, and the existing pool availability checks prevent subsequent reuse.The change preserves the current pool state machine, connection-establishment coordination, and retry policy. Existing requests and response bodies are not canceled by retirement. A late ACK can allow them to complete, but does not restore the entry to the pool. Already-checked-out requests can race with retirement; the feature does not proactively connect or replay requests.
Regression tests use real H2 over duplex IO with both directions paused, without EOF or reset. They cover:
Companion review CI passed the 5 new integration tests, 96 unit tests, 21 legacy-client tests, H1/H2 client feature checks, documentation generation, and formatting checks. The companion Hyper checkout was supplied only through the validation job’s temporary Cargo override.
The intended review order is Hyper API acceptance first, followed by this pool integration and the required released-dependency update.