You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by xy...@apache.org on 2022/12/02 08:14:55 UTC

[pulsar] branch branch-2.8 updated: [branch-2.8]Fix non-durable cursor leak problem (#18711)

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

xyz pushed a commit to branch branch-2.8
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.8 by this push:
     new c22dad319c2 [branch-2.8]Fix non-durable cursor leak problem (#18711)
c22dad319c2 is described below

commit c22dad319c2b6747dbc87a6a6747f8243e79d971
Author: gaozhangmin <zh...@apache.org>
AuthorDate: Fri Dec 2 16:14:49 2022 +0800

    [branch-2.8]Fix non-durable cursor leak problem (#18711)
    
    Co-authored-by: gavingaozhangmin <ga...@didiglobal.com>
---
 .../main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java | 2 ++
 1 file changed, 2 insertions(+)

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 c2a4f38bbe8..c782e79115c 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
@@ -953,6 +953,7 @@ public class ManagedLedgerImpl implements ManagedLedger, CreateCallback {
             return;
         } else if (!cursor.isDurable()) {
             cursors.removeCursor(consumerName);
+            cursor.setInactive();
             callback.deleteCursorComplete(ctx);
             return;
         }
@@ -963,6 +964,7 @@ public class ManagedLedgerImpl implements ManagedLedger, CreateCallback {
             @Override
             public void operationComplete(Void result, Stat stat) {
                 cursor.asyncDeleteCursorLedger();
+                cursor.setInactive();
                 cursors.removeCursor(consumerName);
 
                 // Redo invalidation of entries in cache