Repository navigation
feat(transport): expose h2 reset stream settings on Endpoint - #2972
Conversation
…et_streams on Endpoint Adds Endpoint::http2_reset_stream_duration and Endpoint::http2_max_local_error_reset_streams, the client counterpart of the Server option. Unset keeps hyper's defaults; None disables the local error reset limit. Requires hyper 1.10. Upstream PR: grpc#2972
|
@adriangb might make sense to just combine both your PRs into this one since they are just exposing h2 knobs that feels fine to me. Once you do that and this is ready for review give me a ping we should be able to get this out pretty easily. |
|
I think the main thing I need input in is the bump in the hyper version. The knobs this PR exposes are only available since 1.10. Wdyt of the feature flag approach so that users of grpc-rust can opt-into more hyper options / version bumps but we don't force everyone to bump their hyper versions just for options they may not need? FWIW 1.10 was release May 27th, 2026. |
|
|
sounds good, will merge the prs tomorrow |
Add `Endpoint::http2_max_concurrent_reset_streams`, `Endpoint::http2_reset_stream_duration` and `Endpoint::http2_max_local_error_reset_streams`, and raise the hyper requirement to 1.10, the first release with all three client options.
94be734 to
35b7de0
Compare
Add `Endpoint::http2_max_concurrent_reset_streams`, `Endpoint::http2_reset_stream_duration` and `Endpoint::http2_max_local_error_reset_streams`, and raise the hyper requirement to 1.10, the first release with all three client options. Upstream PR: grpc#2972
|
@LucioFranco consolidated into this PR, I closed #2969. The main question I see left is testing: my agent added a good amount of tests, but I could see them being overkill if we are just passing through an option. But hard for me to asses the strategy here since I'm a new contributor. Wdyt? |
LucioFranco
left a comment
There was a problem hiding this comment.
@adriangb Yeah I agree looks like we are testing the functionality of another crate rather than did the config get set so I would say we can thin the tests down for sure the code is pretty easy to review without it. Once you do that I think we can merge this, thanks!
|
@LucioFranco Removed the integration tests; the PR is now just the three |
|
@LucioFranco done, and did a pass on the docstrings as well |
## 🤖 New release * `tonic`: 0.14.8 -> 0.14.9 (✓ API compatible changes) * `tonic-build`: 0.14.8 -> 0.14.9 * `tonic-prost`: 0.14.8 -> 0.14.9 * `tonic-health`: 0.14.8 -> 0.14.9 * `tonic-types`: 0.14.8 -> 0.14.9 * `tonic-reflection`: 0.14.8 -> 0.14.9 * `tonic-prost-build`: 0.14.8 -> 0.14.9 * `tonic-web`: 0.14.8 -> 0.14.9 <details><summary><i><b>Changelog</b></i></summary><p> ## `tonic` <blockquote> ## [0.14.9](tonic-v0.14.8...tonic-v0.14.9) - 2026-10-29 ### Added - *(transport)* expose h2 reset stream settings on Endpoint ([#2972](#2972)) ### Fixed - *(server)* set a timer on HTTP/1 connections so hyper's header read timeout applies ([#2980](#2980)) </blockquote> ## `tonic-build` <blockquote> ## [0.14.7](tonic-build-v0.14.6...tonic-build-v0.14.7) - 2026-10-26 ### Fixed - fix/silence all clippy warnings ([#2807](#2807)) ### Other - fix changelog duplicate and update repository URLs ([#2943](#2943)) - License update ([#2749](#2749)) </blockquote> ## `tonic-prost` <blockquote> ## [0.14.7](tonic-prost-v0.14.6...tonic-prost-v0.14.7) - 2026-10-26 ### Fixed - fix/silence all clippy warnings ([#2807](#2807)) ### Other - fix changelog duplicate and update repository URLs ([#2943](#2943)) - relax codec Default bounds ([#2681](#2681)) - License update ([#2749](#2749)) </blockquote> ## `tonic-health` <blockquote> ## [0.14.7](tonic-health-v0.14.6...tonic-health-v0.14.7) - 2026-10-26 ### Other - fix changelog duplicate and update repository URLs ([#2943](#2943)) - License update ([#2749](#2749)) </blockquote> ## `tonic-types` <blockquote> ## [0.14.7](tonic-types-v0.14.6...tonic-types-v0.14.7) - 2026-10-26 ### Fixed - *(types)* Serialize `BadRequest::FieldViolation` `reason` and `localized_message` ([#2461](#2461)) - fix/silence all clippy warnings ([#2807](#2807)) ### Other - fix changelog duplicate and update repository URLs ([#2943](#2943)) - License update ([#2749](#2749)) </blockquote> ## `tonic-reflection` <blockquote> ## [0.14.7](tonic-reflection-v0.14.6...tonic-reflection-v0.14.7) - 2026-10-26 ### Fixed - *(reflection)* preserve custom options in served descriptors ([#2730](#2730)) ### Other - fix changelog duplicate and update repository URLs ([#2943](#2943)) - enable missing feature for test build ([#2820](#2820)) - License update ([#2749](#2749)) </blockquote> ## `tonic-prost-build` <blockquote> ## [0.14.7](tonic-prost-build-v0.14.6...tonic-prost-build-v0.14.7) - 2026-10-26 ### Fixed - fix/silence all clippy warnings ([#2807](#2807)) ### Other - fix changelog duplicate and update repository URLs ([#2943](#2943)) - License update ([#2749](#2749)) </blockquote> ## `tonic-web` <blockquote> ## [0.14.8](tonic-web-v0.14.7...tonic-web-v0.14.8) - 2026-10-27 ### Fixed - *(tonic-web)* fix dropped trailers in combined streaming call. ([#2474](#2474)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Replaces #2969, combined here as suggested.
Motivation
When a client resets many streams, a server can still send DATA for them. h2 remembers only 50 reset streams for 1 s by default. DATA for a forgotten stream counts toward the local error reset limit (1024), and reaching it closes the connection with
GOAWAY(ENHANCE_YOUR_CALM, "too_many_internal_resets").Endpointexposes none of these h2 client options today, so a caller must build the connection with hyper directly to change them.Solution
Endpoint::http2_max_concurrent_reset_streams(usize): how many reset streams h2 remembers.Endpoint::http2_reset_stream_duration(Duration): how long h2 remembers a reset stream.Endpoint::http2_max_local_error_reset_streams(impl Into<Option<usize>>), the client counterpart of theServeroption, as in feat(transport): expose http2_max_local_error_reset_streams on Endpoint #2708 (closed). Unset keeps hyper's default of 1024, andNonedisables the limit.hyperrequirement from1to1.10, the first release with the clientreset_stream_durationoption.