Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
feywind opened this issue Mar 3, 2023 · 0 comments · Fixed by #1691
Closed

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

feywind opened this issue Mar 3, 2023 · 0 comments · Fixed by #1691
Assignees
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@feywind
Copy link
Collaborator

feywind commented Mar 3, 2023

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)

@feywind feywind added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 3, 2023
@feywind feywind self-assigned this Mar 3, 2023
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/nodejs-pubsub API. label Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant