This is an automated email from the ASF dual-hosted git repository.

zhangmingao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 78ea7f0ccfe [improve][broker]Use cursor.isActive instead to judge if 
cursor is active (#19159)
78ea7f0ccfe is described below

commit 78ea7f0ccfe511a6a698b4c4b301561ca457d087
Author: gaozhangmin <[email protected]>
AuthorDate: Wed Jan 11 19:58:20 2023 +0800

    [improve][broker]Use cursor.isActive instead to judge if cursor is active 
(#19159)
    
    Co-authored-by: gavingaozhangmin <[email protected]>
---
 .../main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
 
b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
index 7b8fdf1f816..cf109297389 100644
--- 
a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
+++ 
b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
@@ -3663,7 +3663,7 @@ public class ManagedLedgerImpl implements ManagedLedger, 
CreateCallback {
 
     public void activateCursor(ManagedCursor cursor) {
         synchronized (activeCursors) {
-            if (activeCursors.get(cursor.getName()) == null) {
+            if (!cursor.isActive()) {
                 Position positionForOrdering = 
config.isCacheEvictionByMarkDeletedPosition()
                         ? cursor.getMarkDeletedPosition()
                         : cursor.getReadPosition();

Reply via email to