You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "AnonHxy (via GitHub)" <gi...@apache.org> on 2023/03/31 06:27:55 UTC

[GitHub] [pulsar] AnonHxy commented on a diff in pull request #19934: [fix][broker] Return if AbstractDispatcherSingleActiveConsumer closed

AnonHxy commented on code in PR #19934:
URL: https://github.com/apache/pulsar/pull/19934#discussion_r1154064376


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:
##########
@@ -102,6 +102,11 @@ public class PersistentStickyKeyDispatcherMultipleConsumers extends PersistentDi
 
     @Override
     public synchronized void addConsumer(Consumer consumer) throws BrokerServiceException {
+        if (IS_CLOSED_UPDATER.get(this) == TRUE) {
+            log.warn("[{}] Dispatcher is already closed. Closing consumer {}", name, consumer);
+            consumer.disconnect();
+            return;
+        }
         super.addConsumer(consumer);

Review Comment:
   However the `super.addConsumer` return value is `void`. The method in subClass will not fast return if `super.addConsumer` return.  @poorbarcode 



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