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

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


The following commit(s) were added to refs/heads/branch-4.9 by this push:
     new 44a1a4e  [DLOG] LogReader shouldn't be added to pending if not locking
44a1a4e is described below

commit 44a1a4e986e22d87ba340069a7b5619feb30f0dc
Author: Ivan Kelly <[email protected]>
AuthorDate: Wed Oct 23 10:49:00 2019 +0200

    [DLOG] LogReader shouldn't be added to pending if not locking
    
    The pendingReaders set in BKDistributedLogManager exists so that if
    the manager is closed which the lock is being acquired for a reader,
    that reader will be closed (even though it hasn't been returned to the
    client).
    
    In the case that the reader is opened without a lock, there
    is not async action being performed. Previously we were also adding
    these readers to the pendingReaders, but they were never being removed
    from the pendingReaders, causing a memory leak. This change avoids
    adding no-locking readers to pendingReaders.
    
    Reviewers: Enrico Olivelli <[email protected]>
    
    This closes #2185 from ivankelly/orphan-reader
    (cherry picked from commit 4f56edf012de8fbf1e33657b390f01fc823aa2c4)
    
    Signed-off-by: Ivan Kelly <[email protected]>
---
 .../src/main/java/org/apache/distributedlog/BKDistributedLogManager.java | 1 -
 1 file changed, 1 deletion(-)

diff --git 
a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKDistributedLogManager.java
 
b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKDistributedLogManager.java
index 43c0973..36f1e60 100644
--- 
a/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKDistributedLogManager.java
+++ 
b/stream/distributedlog/core/src/main/java/org/apache/distributedlog/BKDistributedLogManager.java
@@ -694,7 +694,6 @@ class BKDistributedLogManager implements 
DistributedLogManager {
                 subscriberId,
                 false,
                 statsLogger);
-        pendingReaders.add(reader);
         return FutureUtils.value(reader);
     }
 

Reply via email to