Skip to content

feat(transport): expose http2_max_local_error_reset_streams on Endpoint#2708

Closed
gautamg795 wants to merge 1 commit into
grpc:masterfrom
get-convex:client-http2-max-local-error-reset-streams
Closed

feat(transport): expose http2_max_local_error_reset_streams on Endpoint#2708
gautamg795 wants to merge 1 commit into
grpc:masterfrom
get-convex:client-http2-max-local-error-reset-streams

Conversation

@gautamg795

Copy link
Copy Markdown

Adds Endpoint::http2_max_local_error_reset_streams, the client-side counterpart to the existing Server::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 with GOAWAY(ENHANCE_YOUR_CALM, "too_many_internal_resets"), failing every in-flight RPC on it. A long-lived client Channel that 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 counted STREAM_CLOSED reset 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.

Server already exposes this knob (for the symmetric server-side case), but Endpoint does 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, and None disables 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

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>
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@gautamg795

Copy link
Copy Markdown
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!

@gautamg795 gautamg795 closed this Jun 26, 2026
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.

1 participant