Skip to content

Support configuring http2_max_pending_accept_reset_streams #657

Description

@lixiaolihua

Background

The underlying hyper/h2 implementation already supports configuring
http2_max_pending_accept_reset_streams, but this option is currently not
exposed by Volo's gRPC server.

In our production environment, we frequently observe the following warning:

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

Representative logs:

{"timestamp":"2026-07-15T10:13:08.670091417+08:00","level":"WARN","fields":{"message":"recv_reset; remotely-reset pending-accept streams reached limit (20)"},"target":"h2::proto::streams::recv"}

{"timestamp":"2026-07-15T10:13:08.682643952+08:00","level":"WARN","fields":{"message":"recv_reset; remotely-reset pending-accept streams reached limit (20)"},"target":"h2::proto::streams::recv"}

{"timestamp":"2026-07-15T10:13:08.758969319+08:00","level":"WARN","fields":{"message":"recv_reset; remotely-reset pending-accept streams reached limit (20)"},"target":"h2::proto::streams::recv"}

These warnings are repeatedly emitted under load, indicating that the default
limit (20) is insufficient for some workloads.

Reference

Hyper exposes this configuration because of the discussion in:

hyperium/hyper#2877

Proposed API

Expose the configuration through the gRPC server builder, similar to the
existing HTTP/2 configuration methods.

pub fn http2_max_pending_accept_reset_streams(
    mut self,
    max: impl Into<Option<usize>>,
) -> Self {
    self.http2_config.max_pending_accept_reset_streams = max.into();
    self
}

Store the value in Http2Config:

pub(crate) max_pending_accept_reset_streams: Option<usize>,

with the default value:

max_pending_accept_reset_streams: None,

Finally, propagate the configuration into Hyper:

server
    .http2()
    // ...
    .max_pending_accept_reset_streams(
        self.http2_config.max_pending_accept_reset_streams,
    );

Benefits

  • Allows applications to tune the limit for workloads with frequent HTTP/2 stream resets.
  • Keeps the current behavior unchanged by default.
  • Aligns Volo with the underlying Hyper API.
  • The implementation is straightforward and fully backward compatible.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions