GeezerVison is showing github.com — fix: concurrent modification of processing receievd messages by maitrimangal · Pull Request #1807 · googleapis/java-pubsub
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
Conversation
When a lot of messages are published, then there is a concurrent modification issue in subscriber callbacks for exactly once. This PR makes the outstandingReciepts a concurrentHashMap, and thus allowing us to remove the synchronized keyword from notifyAckSuccess, and fail because all other data structures in this function are concurrent.
I have tested this as described in the following issue, and am unable to see the modification errors.
Fixes #1778
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I expect the synchronized methods are going to make parallel processing much slower and so we should probably remove that and replace it with a concurrent data structure so move the concurrency control to a lower level. It looks like the pendingAcks, pendingNacks, and pendingReceipts do this. We can hopefully then get rid of the synchronized keyword on notifyAckSuccess and notifyAckFailed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
api: pubsub
Issues related to the googleapis/java-pubsub API.
size: xs
Pull request size is extra small.
Milestone
No milestone
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.
|