nodece commented on code in PR #24638:
URL: https://github.com/apache/pulsar/pull/24638#discussion_r2284439851


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##########
@@ -2229,13 +2229,15 @@ protected void handleCloseConsumer(CommandCloseConsumer 
closeConsumer) {
             // create operation will complete, the new consumer will be 
discarded.
             log.info("[{}] Closed consumer before its creation was completed. 
consumerId={}",
                      remoteAddress, consumerId);
+            consumers.remove(consumerId, consumerFuture);
             commandSender.sendSuccessResponse(requestId);
             return;
         }
 
         if (consumerFuture.isCompletedExceptionally()) {
             log.info("[{}] Closed consumer that already failed to be created. 
consumerId={}",
                      remoteAddress, consumerId);
+            consumers.remove(consumerId, consumerFuture);

Review Comment:
   > @nodece wants to remove a consumer future that has not been done. Which is 
the main change of this PR.
   
   I know the real subscription future has not been done. Once the consumer 
closes the subscription, I think the consumer can use the same consumer id to 
send a new subscription.
   
   > Could you explain the progress of reproducing the issue?
   
   You can see this: 
https://github.com/apache/pulsar/pull/24638#issuecomment-3197127542
   
   > seems it is a client-side bug, which should not call removing before the 
subscribing is done. If the consumer can not confirm the result of the command 
that registering the consumer, the client should close the socket
   
   Not a bug. Once the consumer checks the request timeout, it will send the 
close subscription request to the broker.
   
   Please see 
https://github.com/apache/pulsar/blob/v3.0.12/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L907-L914
   
   
   



-- 
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-unsubscr...@pulsar.apache.org

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

Reply via email to