lhotari commented on code in PR #24920:
URL: https://github.com/apache/pulsar/pull/24920#discussion_r2476514203


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractDispatcherSingleActiveConsumer.java:
##########
@@ -176,6 +176,11 @@ public synchronized CompletableFuture<Void> 
addConsumer(Consumer consumer) {
                         return FutureUtil.failedFuture(new 
ConsumerBusyException("Exclusive consumer is already"
                                 + " connected"));
                     } else {
+                        try {
+                            removeConsumer(actConsumer);
+                        } catch (BrokerServiceException e) {
+                            log.warn("[{}] Remove inactive exclusive consumer 
{}", this.topicName, consumer);
+                        }

Review Comment:
   I don't think that this is the correct solution. The consumer gets removed 
when the connection is closed:
   
https://github.com/apache/pulsar/blob/acad78c10f0c0c4756d2dd73bf729bb2f84f53e7/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java#L438-L462
   
   I'd suppose that there's a race condition that isn't properly handled.
   



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