fix(pubsub): publish messages larger than the configured batch threshold#4822
Merged
PhongChuong merged 2 commits intogoogleapis:mainfrom Feb 26, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4822 +/- ##
==========================================
+ Coverage 94.94% 94.96% +0.01%
==========================================
Files 205 205
Lines 8059 8047 -12
==========================================
- Hits 7652 7642 -10
+ Misses 407 405 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
suzmue
requested changes
Feb 25, 2026
Collaborator
suzmue
left a comment
There was a problem hiding this comment.
Can you please add a test that covers this case?
Reading the code it doesn't seem like this will actually add the too big message to a batch. Doesn't can_add always return false so it just tries flush the empty batch? Even if so, I'd like to see a test to check the behavior.
Collaborator
Author
|
@suzmue , added the tests. Good catch on the sequential actor empty message issue. PTAL. |
6f8f8ef to
e5076fe
Compare
suzmue
approved these changes
Feb 26, 2026
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.
This PR removes the ExceededByteThresholdError. The Publisher now sends the messages that are larger than the configured batch threshold in its own batch. For messages that are larger than the server message size limit, the Publisher will send the message and return the server side error message to the application. Similar to other server errors, if and only if the message have an ordering key, then we pause Publishing for that key.
This also remove the publisher_publish_msg_too_big test for Publisher as the case is handled the same way as any other server side error.
Fixes #4650