Skip to content

feat(transport): expose h2 reset stream settings on Endpoint - #2972

Merged
LucioFranco merged 4 commits into
grpc:masterfrom
pydantic:client-h2-reset-stream-duration
Oct 29, 2026
Merged

LucioFranco merged 4 commits into
grpc:masterfrom
pydantic:client-h2-reset-stream-duration

Conversation

@adriangb

@adriangb adriangb commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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"). Endpoint exposes none of these h2 client options today, so a caller must build the connection with hyper directly to change them.

Solution

  • Add Endpoint::http2_max_concurrent_reset_streams(usize): how many reset streams h2 remembers.
  • Add Endpoint::http2_reset_stream_duration(Duration): how long h2 remembers a reset stream.
  • Add Endpoint::http2_max_local_error_reset_streams(impl Into<Option<usize>>), the client counterpart of the Server option, as in feat(transport): expose http2_max_local_error_reset_streams on Endpoint #2708 (closed). Unset keeps hyper's default of 1024, and None disables the limit.
  • Raise tonic's hyper requirement from 1 to 1.10, the first release with the client reset_stream_duration option.

adriangb added a commit to pydantic/grpc-rust that referenced this pull request Oct 28, 2026
…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
@LucioFranco

Copy link
Copy Markdown
Member

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

@adriangb

Copy link
Copy Markdown
Contributor Author

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.

@LucioFranco

Copy link
Copy Markdown
Member

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.
bumping a version like this is totally fine and not a breaking change since users can upgrade without breaking their code, so not concerned about that portion at all.

@adriangb

Copy link
Copy Markdown
Contributor Author

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.
@adriangb
adriangb force-pushed the client-h2-reset-stream-duration branch from 94be734 to 35b7de0 Compare October 29, 2026 02:51
adriangb added a commit to pydantic/grpc-rust that referenced this pull request Oct 29, 2026
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
@adriangb adriangb changed the title feat(transport): expose reset_stream_duration and max_local_error_reset_streams on Endpoint feat(transport): expose h2 reset stream settings on Endpoint Oct 29, 2026
@adriangb

adriangb commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

@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 LucioFranco left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@adriangb

Copy link
Copy Markdown
Contributor Author

@LucioFranco Removed the integration tests; the PR is now just the three Endpoint options, their doc examples, and the hyper bump.

@adriangb

Copy link
Copy Markdown
Contributor Author

@LucioFranco done, and did a pass on the docstrings as well

@adriangb
adriangb requested a review from LucioFranco October 29, 2026 16:41

@LucioFranco LucioFranco left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LucioFranco
LucioFranco merged commit a47b608 into grpc:master Oct 29, 2026
18 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 29, 2026
LucioFranco pushed a commit that referenced this pull request Oct 29, 2026
## 🤖 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>
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.

2 participants