forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLSR-1456: Fix race condition on producer/consumer maps in ServerCnx (a…
…pache#9256) ServerCnx had a callback that was called from Producer/Consumer which would remove the producer/consumer from its map using only the ID. However, it is possible that this callback runs when the producer/consumer had already been removed from the map and another producer/consumer added in its place. The solution is to use both the key and value when removing from the map. The change also updates the log messages to include the producerId and consumerId in a format that all log messages for an individual producerId/consumerId can be easier found. A test has been changed because the test was depending on the broken behaviour. What was happening was that the fail topic producer was failing to create a producer, and when this happened it removed the producer future for the successful producer. Then, when the third producer tries to connect, it sees manages to create the producer on the connection, but fails as there is already a producer with that name on the topic. The correct behaviour is that it should see the successful producer future for that ID and respond with success. Co-authored-by: Ivan Kelly <[email protected]>
- Loading branch information
Showing
2 changed files
with
79 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters