transport: add max_frame_size to client Endpoint#2592
Open
timlee0119 wants to merge 1 commit intohyperium:masterfrom
Open
transport: add max_frame_size to client Endpoint#2592timlee0119 wants to merge 1 commit intohyperium:masterfrom
timlee0119 wants to merge 1 commit intohyperium:masterfrom
Conversation
Mirrors the existing server-side `Server::max_frame_size` API. The underlying hyper `Builder` already supports this; this change simply wires the option through from `Endpoint` configuration. This enables clients to configure the maximum HTTP/2 frame size, which is useful for supporting large payloads without excessive frame fragmentation. Includes integration test verifying the new API works with the server. Refs: hyperium#264
Author
|
@dfawley gentle ping on this tiny PR. Thanks! |
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.
Motivation
tonic already exposes
Server::max_frame_size()to let servers configure this parameter, but theclient-side
Endpointstruct has no equivalent API. The underlying hyper HTTP/2Builderalreadysupports
.max_frame_size(), so this change simply wires it through from the client-side endpointconfiguration.
I've seen production speedup in our gRPC service by increasing this client-side
max_frame_sizeto allow the server to send a large response (multi-MB) without excessive framing overheads caused by the default 16 KiB setting.Solution
Add a new
max_frame_sizefield to theEndpointstruct and expose it via a public builder method,mirroring the server-side pattern:
max_frame_size: Option<u32>field toEndpointpub fn max_frame_size(self, frame_size: impl Into<Option<u32>>) -> Selfbuilder methodBuilder::max_frame_size()inconnection.rsRefs: #264