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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:
##########
@@ -338,11 +337,14 @@ public synchronized void removeConsumer(Consumer 
consumer, boolean isResetCursor
                     if (!isResetCursor) {
                         try {
                             
topic.getManagedLedger().deleteCursor(cursor.getName());
+                            
topic.getManagedLedger().removeWaitingCursor(cursor);
                         } catch (InterruptedException | ManagedLedgerException 
e) {
                             log.warn("[{}] [{}] Failed to remove non durable 
cursor", topic.getName(), subName, e);
                         }
                     }
                 });
+            } else {
+                topic.getManagedLedger().removeWaitingCursor(cursor);

Review Comment:
   here's the diff of my experiment compared to the changes of this PR: 
https://github.com/Technoboy-/pulsar/compare/fix-22435...lhotari:pulsar:lh-remove-addWaitingCursor-conditions
   
   I think that the proper way to fix the problem is to add the closed check to 
`checkForNewEntries` method and set the state to closed when the cursor is 
deleted.



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