You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by iv...@apache.org on 2019/10/23 08:51:21 UTC
[bookkeeper] branch branch-4.8 updated: [DLOG] LogReader shouldn't
be added to pending if not locking
This is an automated email from the ASF dual-hosted git repository.
ivank pushed a commit to branch branch-4.8
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/branch-4.8 by this push:
new 4fa1461 [DLOG] LogReader shouldn't be added to pending if not locking
4fa1461 is described below
commit 4fa14617a855df236a902e76c8c68a21952bb48a
Author: Ivan Kelly <iv...@apache.org>
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 <eo...@gmail.com>
This closes #2185 from ivankelly/orphan-reader
(cherry picked from commit 4f56edf012de8fbf1e33657b390f01fc823aa2c4)
Signed-off-by: Ivan Kelly <iv...@apache.org>
---
.../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);
}