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

[GitHub] [pulsar] gaoran10 commented on a diff in pull request #19692: [fix] [broker] Topic close failure leaves subscription in a permanent fence state

gaoran10 commented on code in PR #19692:
URL: https://github.com/apache/pulsar/pull/19692#discussion_r1123997298


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:
##########
@@ -897,27 +898,62 @@ public CompletableFuture<Void> close() {
      */
     @Override
     public synchronized CompletableFuture<Void> disconnect() {
-        CompletableFuture<Void> disconnectFuture = new CompletableFuture<>();
+        if (fenceFuture != null && !fenceFuture.isDone()){
+            return fenceFuture;
+        }
+        if (fenceFuture != null && fenceFuture.isDone() && !fenceFuture.isCompletedExceptionally()){
+            return fenceFuture;

Review Comment:
   It seems that if PersistentSubscription disconnect successfully, but PersistentTopic close failed and resume, the PersistentSubscription can't disconnect again.



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