-
Notifications
You must be signed in to change notification settings - Fork 1.7k
PubSub: check batch max bytes against request byte size #7108
Copy link
Copy link
Closed
Labels
🚨This issue needs some love.This issue needs some love.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
🚨This issue needs some love.This issue needs some love.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.
Is your feature request related to a problem? Please describe.
google.cloud.pubsub_v1.publisher._batch.thread.Batchenforces max bytes on the sum ofPubsubMessage.ByteSizefor each message in the batch, but thePublishRequestcreated byBatch.client.publishis larger than that. As a result I need to specify a non default max bytes to guarantee batches create valid requests.Describe the solution you'd like
Enforce max bytes on the size of the
PublishRequestcreated byBatch.client.publish:Describe alternatives you've considered
I can set max bytes to guarantee sufficient overhead, but I feel like it would be better if I didn't need to and this may result in fewer batches.
Additional context
see also #7107, which suggests adding an option to enforce this setting even when the batch is empty.