-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Can't receive messages larger than 4MiB #3594
Copy link
Copy link
Closed
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Cloud Pub/Sub has a maximum message size of around 10 MiB (source). gRPC has a default max message size of 4MiB, so there are valid messages that cannot be pulled by google-cloud-python.
These messages appear to be silently dropped, as the pull request generates
<_Rendezvous of RPC that terminated with (StatusCode.RESOURCE_EXHAUSTED, Received message larger than max (8106187 vs. 4194304))>but this is considered to be a transient error so the request is retried. When the next call to Pull() returns no messages, the application receives no messages. (behaviour may be different with production Pub/Sub servers, as I encountered this testing against an emulator)This limit was lifted for the BigTable client in #2907, but this change didn't affect other clients. For PubSub, it can be fixed by setting the max message size options (as done for BigTable) in make_gax_publisher_api / make_gax_subscriber_api.