Skip to content

Messages queues don't wait for the next batch timeout if a previous one finishes #1690

@feywind

Description

@feywind

An earlier change made the message queues continue trying to send messages until the queues are empty (so that drain works). However, because of async code, it's possible that more messages might legitimately fill in that we don't want to send immediately (batching instead of flush). This was caused by:

https://github.com/googleapis/nodejs-pubsub/pull/1636/files#diff-71cf1b7861b4cf165750fbfb5f22b7e03e93044ac050a2f66895fe63ad6703e6R175

The visible symptom is that you can set a max number of messages in a batch with a long max timeout, and then do async publishMessage() for more than the max number of messages, but all of them will basically send at once, instead of waiting for the timeout for the second batch. (bug 270113896)

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the googleapis/nodejs-pubsub API.priority: p2Moderately-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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions