poorbarcode commented on code in PR #22283:
URL: https://github.com/apache/pulsar/pull/22283#discussion_r1533976409


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##########
@@ -190,9 +190,15 @@ public synchronized CompletableFuture<Void> 
addConsumer(Consumer consumer) {
         }
 
         if (isConsumersExceededOnSubscription()) {
-            log.warn("[{}] Attempting to add consumer to subscription which 
reached max consumers limit", name);
+            log.warn("[{}] Attempting to add consumer to subscription which 
reached max consumers limit {}",
+                    name, consumer);
             return FutureUtil.failedFuture(new 
ConsumerBusyException("Subscription reached max consumers limit"));
         }
+        if (consumerSet.contains(consumer)) {

Review Comment:
   Used a new solution that prevents subsequent subscribing until the previous 
one is done, which guarantees that no race condition about twice subscribing.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to