You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/04/01 06:46:06 UTC

[GitHub] [pulsar] eolivelli commented on a change in pull request #14970: [fix][broker] The offline consumer is not removed from the consumerList

eolivelli commented on a change in pull request #14970:
URL: https://github.com/apache/pulsar/pull/14970#discussion_r840281674



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
##########
@@ -153,6 +153,14 @@ public synchronized void addConsumer(Consumer consumer) throws BrokerServiceExce
             throw new ConsumerBusyException("Subscription reached max consumers limit");
         }
 
+        if (consumerList.contains(consumer)) {
+            log.warn("[{}] Consumer with the same id is already created:"
+                            + " consumerId={}, consumer={}",
+                    consumer.cnx().clientAddress(), consumer.consumerId(), consumer);
+            throw new BrokerServiceException("Consumer with the same id is already created!");

Review comment:
       what about using ConsumerBusyException ?

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
##########
@@ -153,6 +153,14 @@ public synchronized void addConsumer(Consumer consumer) throws BrokerServiceExce
             throw new ConsumerBusyException("Subscription reached max consumers limit");
         }
 
+        if (consumerList.contains(consumer)) {
+            log.warn("[{}] Consumer with the same id is already created:"
+                            + " consumerId={}, consumer={}",
+                    consumer.cnx().clientAddress(), consumer.consumerId(), consumer);
+            throw new BrokerServiceException("Consumer with the same id is already created!");
+

Review comment:
       nit: remove useless newline




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org