BewareMyPower commented on code in PR #23951:
URL: https://github.com/apache/pulsar/pull/23951#discussion_r1948399488


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -1144,16 +1144,16 @@ public ManagedCursor newNonDurableCursor(Position 
startCursorPosition, String cu
             return cachedCursor;
         }
 
-        NonDurableCursorImpl cursor = new NonDurableCursorImpl(bookKeeper, 
this, cursorName,
-                startCursorPosition, initialPosition, isReadCompacted);
-        cursor.setActive();
-
-        log.info("[{}] Opened new cursor: {}", name, cursor);
+        // To avoid cursor initialization and "ML.trimLedgers" execute 
concurrency, we add this lock block.
+        // See details https://github.com/apache/pulsar/pull/23951.

Review Comment:
   ```suggestion
           // Add this lock block to avoid cursor initialization and 
`internalTrimLedgers` execution concurrency.
           // See details in https://github.com/apache/pulsar/pull/23951.
   ```
   
   `ML.trimLedgers` is hard to understand, use the actual method name 
`internalTrimLedgers` instead.
   
   Besides, correct the grammar errors (via the Copilot plugin in VSCode)



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