forked from apache/pulsar
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Producer getting producer busy is removing existing producer from list (
apache#11804) ### Motivation When a producer is getting error because of ProducerBusy (existing producer with the same name), it will trigger a producer close operation that will eventually lead to the existing producer getting removed from the topic map (even though that producer is still writing on the topic). The problem is the producer close is triggering a removal from the map: pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java Line 683 in 43ded59 if (producers.remove(producer.getProducerName(), producer)) { Even though we check for producer equality, the Producer.equals() is only comparing the producer name, so the old instance gets removed from the map. Instead, the equality of producer needs to be based on the connection id (local & remote addresses and unique id), plus the producer id within that connection. * Producer getting producer busy is removing existing producer from list * Fixed test (cherry picked from commit 6aef83f)
- Loading branch information
1 parent
c7261c1
commit 8d9ab07
Showing
3 changed files
with
67 additions
and
1 deletion.
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
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