You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by ch...@apache.org on 2023/02/08 07:47:09 UTC

[bookkeeper] 02/02: Fix QueueEntry recycle problem. (#3747)

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

chenhang pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit e841a3d5236f58b2c18d3e5f13299f389804ddc5
Author: Yan Zhao <ho...@apache.org>
AuthorDate: Fri Feb 3 10:34:41 2023 +0800

    Fix QueueEntry recycle problem. (#3747)
    
    Descriptions of the changes in this PR:
    In the QueueEntry recycle, it only recycles itself to the object pool, but didn't reset some properties.
    Like entry, cb, etc. We should reset the filed before recycles itself.
    
    (cherry picked from commit 901f76ce4c4f9f771363424dbb60da4d590ad122)
---
 .../src/main/java/org/apache/bookkeeper/bookie/Journal.java          | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
index 02e5de5228..b01cc3115e 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
@@ -350,6 +350,11 @@ public class Journal extends BookieCriticalThread implements CheckpointSource {
         };
 
         private void recycle() {
+            this.entry = null;
+            this.cb = null;
+            this.ctx = null;
+            this.journalAddEntryStats = null;
+            this.journalCbQueueSize = null;
             recyclerHandle.recycle(this);
         }
     }