feat(transport): expose http2_max_local_error_reset_streams on Endpoint#2708
Closed
gautamg795 wants to merge 1 commit into
Closed
feat(transport): expose http2_max_local_error_reset_streams on Endpoint#2708gautamg795 wants to merge 1 commit into
gautamg795 wants to merge 1 commit into
Conversation
Adds the client-side counterpart to Server::http2_max_local_error_reset_streams so callers can raise or disable h2's per-connection local-reset limit. Without it, a long-lived client connection that cancels many server-streaming RPCs accrues local resets and is eventually torn down with GOAWAY(ENHANCE_YOUR_CALM, "too_many_internal_resets"). Leaving it unset preserves hyper's default (1024). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Author
|
Closing for now — going to validate this against our internal services first before bringing it upstream. Will reopen once the approach is confirmed. Thanks! |
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.
Adds
Endpoint::http2_max_local_error_reset_streams, the client-side counterpart to the existingServer::http2_max_local_error_reset_streams.Why this is needed. h2 caps the number of local error resets a connection may accumulate over its lifetime (
max_local_error_reset_streams, default 1024); once past it, h2 closes the connection withGOAWAY(ENHANCE_YOUR_CALM, "too_many_internal_resets"), failing every in-flight RPC on it. A long-lived clientChannelthat legitimately cancels many server-streaming RPCs — e.g. dropping the response stream on client disconnect or timeout — steadily accrues these resets: an abandoned stream yields a countedSTREAM_CLOSEDreset once h2 has forgotten the stream and the peer's in-flight DATA arrives. Under sustained load this trips the limit and tears the connection down.Serveralready exposes this knob (for the symmetric server-side case), butEndpointdoes not — so today there is no way to raise or disable the limit on an outbound connection without patching tonic.Behavior. Mirrors the server method's
Option<usize>signature. Non-breaking: when unset, hyper's default (currently 1024) is unchanged; only an explicit call overrides it, andNonedisables the limit (advisable only for trusted peers, e.g. internal services).Opening as a draft for maintainer feedback on the approach.
🤖 Generated with Claude Code