Conversation
Signed-off-by: 1fanwang <1fannnw@gmail.com>
|
Assigning reviewers: R: @kennknowles for label java. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
Reminder, please take a look at this pr: @kennknowles |
|
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment R: @ahmedabu98 for label java. Available commands:
|
|
R: @sjvanrossum Since you made some of the surrounding comments, are you able to review this? |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
Bounded PubsubIO writes size each batch from the message payload alone. Attributes and ordering keys are omitted, so the writer can publish a batch larger than
maxPublishBatchByteSize.validatePubsubMessagealready returns the validated size of the payload, ordering key, and attributes. The bounded writer now uses that value instead of discarding it and recalculatingmessageSizefrom the payload.This does not address #31800. Its existing TODOs cover JSON versus Protobuf encoding and HTTP to gRPC transcoding.
Fixes #28011
Testing
The regression sends two 27-byte messages through the real bounded-writer lifecycle with a 40-byte batch limit and captures each publish call. To reproduce against base
13875fc6bd3d5ad534c89d33f2395176fbc485fcwhile keeping the regression test from this branch:Both messages were sent in one batch:
After the fix:
The captured batch sizes are now
[1, 1], so neither publish exceeds the configured limit. The fullPubsubIOTestclass also passes with the same Gradle task and the class-level test selector.CHANGES.mdis unchanged for this small bug fix.