Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

MaxMessageSize is not altered, making delivery impossible over gRPC for some APIs #149

Closed
mdietz94 opened this issue Nov 18, 2016 · 4 comments
Assignees
Labels
blocking GCJ GA 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@mdietz94
Copy link

For Cloud Pub/Sub, the maximum possible PullResponse is 20 MB large. The default gRPC Channel maxMessageSize is 4 MB. This should be configured per API, or some messages will be silently undeliverable.

@garrettjonesgoogle
Copy link
Member

garrettjonesgoogle commented Nov 18, 2016

@ejona86 , is there a drawback to setting maxMessageSize to a large value for all APIs?

@ejona86
Copy link

ejona86 commented Nov 19, 2016

The user would have to be willing to receive large responses, and remember that they can explode in size when deserializing. The max message size is there to prevent large requests/responses without actually considering the stability impact to the service/users.

If a user uploads a 20 MB message, then it can be reasonable to increase the default limit and let them receive it. If the user uploads 20 x 1 MB messages, and they are all sent back all-at-once in one response, then it seems like it could be surprising to the user and may contribute to OOM. Let's just say someone was using the service from a mobile phone. I'm not saying that's a good idea, but 20 MB is a lot of memory to some users still (and it could easily be 100 MB or more after deserializing).

The 4 MB is arbitrary, so you can change it to another arbitrary value. gRPC itself is okay with a message being 100s of MBs and we know services that adjust the limit to do so. But the limit is there for a reason.

@garrettjonesgoogle
Copy link
Member

This is blocked on grpc/grpc-java#2563 .

@garrettjonesgoogle
Copy link
Member

Let's use ManagedChannelBuilder.maxInboundMessageSize(int) from GAX.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocking GCJ GA 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

5 participants