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

[GitHub] [pulsar] poorbarcode commented on a diff in pull request #19858: [fix] [cli] Release the orphan producers after the primary consumer is closed

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


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -1050,7 +1050,19 @@ public CompletableFuture<Void> closeAsync() {
             });
         }
 
-        return closeFuture;
+        return closeFuture.thenCompose(ignore -> {
+            if (retryLetterProducer != null){
+                return retryLetterProducer.closeAsync();

Review Comment:
   > Should we close them parallelly? 
   
   Fixed.
   
   > Do you think we should make some special exception handling here?
   
   Yes, if closing these producers fail, users can not retry to close them again, so just print a warning log. Or two other implementations: 
   - Make this method retryable.
   - Do retry these producers' close silently
   Since there are few scenarios where failure occurs, such as when the connection has been broken (no longer necessary to retry the close), just print a warning log.



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