feat(volo-grpc): expose http2_max_pending_accept_reset_streams on Server - #665
Open
icn5381 wants to merge 1 commit into
Open
feat(volo-grpc): expose http2_max_pending_accept_reset_streams on Server#665icn5381 wants to merge 1 commit into
icn5381 wants to merge 1 commit into
Conversation
hyper/h2 already supports capping the number of remotely-reset streams pending acceptance before closing the connection, but volo-grpc's gRPC server didn't expose it. Under load, servers hit hyper's default limit (20) and log repeated "remotely-reset pending-accept streams reached limit" warnings with no way to raise it. Adds Server::http2_max_pending_accept_reset_streams, following the same Http2Config passthrough pattern as the other http2_* setters (http2_max_concurrent_streams, http2_max_header_list_size, etc). Default is unchanged (None, i.e. hyper's own default). Closes cloudwego#657
Author
|
I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: 255778606+icn5381@users.noreply.github.com |
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.
References
Closes #657
Why
The underlying hyper/h2 server already supports capping the number of remotely-reset streams pending acceptance before the connection is closed (
max_pending_accept_reset_streams, defaulting to 20 in h2), butvolo-grpc'sServerdidn't expose this knob. Under load with frequent stream resets, this surfaces as repeated warnings:with no way for the application to raise the limit.
What changed
Added
Server::http2_max_pending_accept_reset_streams, following the exact sameHttp2Configpassthrough pattern already used by the sibling setters (http2_max_concurrent_streams,http2_max_header_list_size,http2_max_frame_size, etc.):Http2Config::max_pending_accept_reset_streams: Option<usize>field, defaulting toNone(unchanged behavior — hyper's own default of 20 still applies).Server::http2_max_pending_accept_reset_streams(max: impl Into<Option<usize>>).hyper_utilHTTP/2 builder alongside the otherhttp2_*config calls.This is purely additive — no existing behavior changes, no new dependencies (the method already exists on
hyper_util::server::conn::auto::Http2Builder).Surface area
Validation
All pass. Added two unit tests (
http2_max_pending_accept_reset_streams_defaults_to_none,http2_max_pending_accept_reset_streams_sets_value) covering the default and the builder wiring — the crate had no prior unit tests for the siblinghttp2_*config setters to follow, so this establishes the pattern for this one field.AI assistance
hyper_util::server::conn::auto::Http2Builder::max_pending_accept_reset_streams) matches the reporter's proposed API, implemented the field/builder/wiring following the existingHttp2Configpattern, and wrote the two unit tests.cargo build/clippy/fmt --check/testmyself and confirmed all pass; confirmed the change only touchesvolo-grpc/src/server/mod.rswith no unrelated edits; take responsibility for this change.