Skip to content

feat(volo-grpc): expose http2_max_pending_accept_reset_streams on Server - #665

Open
icn5381 wants to merge 1 commit into
cloudwego:mainfrom
icn5381:feat/657-http2-max-pending-accept-reset-streams
Open

feat(volo-grpc): expose http2_max_pending_accept_reset_streams on Server#665
icn5381 wants to merge 1 commit into
cloudwego:mainfrom
icn5381:feat/657-http2-max-pending-accept-reset-streams

Conversation

@icn5381

@icn5381 icn5381 commented Aug 13, 2026

Copy link
Copy Markdown

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), but volo-grpc's Server didn't expose this knob. Under load with frequent stream resets, this surfaces as repeated warnings:

recv_reset; remotely-reset pending-accept streams reached limit (20)

with no way for the application to raise the limit.

What changed

Added Server::http2_max_pending_accept_reset_streams, following the exact same Http2Config passthrough pattern already used by the sibling setters (http2_max_concurrent_streams, http2_max_header_list_size, http2_max_frame_size, etc.):

  • New Http2Config::max_pending_accept_reset_streams: Option<usize> field, defaulting to None (unchanged behavior — hyper's own default of 20 still applies).
  • New builder method Server::http2_max_pending_accept_reset_streams(max: impl Into<Option<usize>>).
  • Wired into the hyper_util HTTP/2 builder alongside the other http2_* 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

  • New feature (non-breaking change which adds functionality)

Validation

cargo build -p volo-grpc --all-features
cargo clippy -p volo-grpc --all-features
cargo fmt -p volo-grpc -- --check
cargo test -p volo-grpc http2_max_pending_accept_reset_streams

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 sibling http2_* config setters to follow, so this establishes the pattern for this one field.

AI assistance

  • Tool(s) used: Claude Code
  • How you used it: AI verified the exact hyper/h2 API surface (hyper_util::server::conn::auto::Http2Builder::max_pending_accept_reset_streams) matches the reporter's proposed API, implemented the field/builder/wiring following the existing Http2Config pattern, and wrote the two unit tests.
  • Human verification: Read and understood every line of this change; confirmed via the vendored hyper/hyper-util source that the method exists with the expected signature before writing any code; ran cargo build/clippy/fmt --check/test myself and confirmed all pass; confirmed the change only touches volo-grpc/src/server/mod.rs with no unrelated edits; take responsibility for this change.
  • I've read and understand every line of this change and take responsibility for it.

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
@CLAassistant

CLAassistant commented Aug 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@icn5381

icn5381 commented Aug 13, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: 255778606+icn5381@users.noreply.github.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Support configuring http2_max_pending_accept_reset_streams

2 participants