sijie commented on a change in pull request #5571: Add epoch for connection 
handler to handle create producer timeout.
URL: https://github.com/apache/pulsar/pull/5571#discussion_r343008251
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
 ##########
 @@ -425,8 +425,22 @@ public void addProducer(Producer producer) throws 
BrokerServiceException {
             }
 
             if (!producers.add(producer)) {
-                throw new NamingException(
-                        "Producer with name '" + producer.getProducerName() + 
"' is already connected to topic");
+                boolean canOverwrite = false;
+                for (Producer existProducer : producers.values()) {
 
 Review comment:
   Can we avoid iterating over the producers set? I.e. can you change the hash 
set to a hash map?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to