Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting a message max size #264

Closed
awaited-hare opened this issue Feb 14, 2020 · 7 comments
Closed

Allow setting a message max size #264

awaited-hare opened this issue Feb 14, 2020 · 7 comments
Labels
A-tonic C-enhancement Category: New feature or request E-help-wanted Call for participation: Help is requested to fix this issue.
Milestone

Comments

@awaited-hare
Copy link
Contributor

Feature Request

Motivation

See tensorflow/serving#1382, if the message size is large, tonic currently does not support changing the max message size.

Proposal

Expose the API the change allowed message size.

@LucioFranco LucioFranco added A-tonic C-enhancement Category: New feature or request E-help-wanted Call for participation: Help is requested to fix this issue. labels Feb 16, 2020
@akiradeveloper
Copy link

@l1an0 @LucioFranco What is the maximum message size allowed now? As far as I understand, gRPC's default max size in spec is 4MB but tonic server seems to be capable of receive larger requests.

@LucioFranco
Copy link
Member

I believe there is a cap with h2, its a bug. related issue is here for that @akiradeveloper #352

@akiradeveloper
Copy link

@LucioFranco Thanks for you reply but my question is why tonic doesn't have an upper limit as official implementations do

https://github.com/grpc/grpc/releases/tag/v1.29.0

A significant change was made in #22575 where gRPC Core will check whether the decompressed message fits in the configured limit for the maximum message length that the channel can receive. (The default limit is 4MB.)

Is that your intention not to comply with the official behaviors?

@LucioFranco LucioFranco changed the title cannot set max messsage size Allow setting a message max size Aug 13, 2020
@LucioFranco
Copy link
Member

@LucioFranco Thanks for you reply but my question is why tonic doesn't have an upper limit as official implementations do

I don't believe this is specified in the protocol definition so it was never added initially. Would be happy to add it if people want this behavior.

Is that your intention not to comply with the official behaviors?

Just because gRPC core does it, doesn't mean its "official" per-say. Each implemenation of gRPC has its own niche things. I would love to add this but I don't have the time currently. I would totally accept a PR though.

@LucioFranco LucioFranco added this to the 0.4 milestone Nov 27, 2020
SkamDart pushed a commit to SkamDart/tonic that referenced this issue Jan 8, 2021
Exposes option to configure the max http2 frame size used by the
underlying hyper server via the `tonic::transport::Server` builder.

Refs: hyperium#264
LucioFranco pushed a commit that referenced this issue Jan 15, 2021
* tonic: add max http2 frame size to server.

Exposes option to configure the max http2 frame size used by the
underlying hyper server via the `tonic::transport::Server` builder.

Refs: #264

* fix http2_* methods broken in merge conflict
@davidpdrsn
Copy link
Member

It seems this was fixed by #529. Just re-open if that is not the case.

@sfackler
Copy link

sfackler commented Aug 4, 2022

Unless I'm misreading the spec, the h2 maximum frame size is unrelated to the maximum gRPC message size: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#data-frames. From some quick testing, it appears that tonic will consume arbitrarily large messages.

@LucioFranco
Copy link
Member

Yes, I believe the C++ implementation has a non-h2 limit as well. We could add this via Grpc types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tonic C-enhancement Category: New feature or request E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
5 participants