Technoboy- commented on code in PR #22454:
URL: https://github.com/apache/pulsar/pull/22454#discussion_r1555201939


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -3815,7 +3815,7 @@ public void removeWaitingCursor(ManagedCursor cursor) {
 
     public void addWaitingCursor(ManagedCursorImpl cursor) {
         if (cursor instanceof NonDurableCursorImpl) {
-            if (cursor.isActive()) {
+            if (cursors.get(cursor.getName()) != null) {

Review Comment:
   > Please remove addWaitingCursor method or make it simply 
this.waitingCursors.add(cursor); without any conditions.
   Oh, we can't remove this method. because we have removed the cursor from the 
`waitingCursor ` when consumer unsubscribe.
   You can use `testAddWaitingCursorsForNonDurable` to reproduce



##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -3815,7 +3815,7 @@ public void removeWaitingCursor(ManagedCursor cursor) {
 
     public void addWaitingCursor(ManagedCursorImpl cursor) {
         if (cursor instanceof NonDurableCursorImpl) {
-            if (cursor.isActive()) {
+            if (cursors.get(cursor.getName()) != null) {

Review Comment:
   > Please remove addWaitingCursor method or make it simply 
this.waitingCursors.add(cursor); without any conditions.
   
   Oh, we can't remove this method. because we have removed the cursor from the 
`waitingCursor ` when consumer unsubscribe.
   You can use `testAddWaitingCursorsForNonDurable` to reproduce



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