PubSub: Message ordering no longer being honored #1889
Labels
api: pubsub
Issues related to the googleapis/java-pubsub API.
priority: p1
Important issue which blocks shipping the next release. Will be fixed prior to next release.
Environment details
General, Core, and Other are also allowed as types
Steps to reproduce
Code example
Stack trace
This also seems to lead to more frequent occurrences of this stack trace
External references such as API reference guides
n/a
Any additional information below
The above code snippet works fine in 1.125.11, but in 1.125.12 and 1.126.2 (the latest as of raise date) we are getting messages delivered out of order.
I believe the root cause is the change from #1778 where under #1807 the LinkedHashSet was changed to a ConcurrentHashMap. When the notifyAckSuccess method is called, we are iterating over the outstandingReceipts to put into the outstandingBatch. Unfortunately this change switched it from insertion order to hash based ordering.
I can mitigate all of these issues by setting the max-outstanding-element-count down to 1, but then we lose the ability to parallel process, or the benefits of batching.
The text was updated successfully, but these errors were encountered: