Skip to content

[DLOG] LogReader shouldn't be added to pending if not locking#2185

Merged
ivankelly merged 1 commit intoapache:masterfrom
ivankelly:orphan-reader
Oct 23, 2019
Merged

[DLOG] LogReader shouldn't be added to pending if not locking#2185
ivankelly merged 1 commit intoapache:masterfrom
ivankelly:orphan-reader

Conversation

@ivankelly
Copy link
Contributor

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.

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.
@eolivelli
Copy link
Contributor

This code is new to me, but the change looks good to me.

Unfortunately ASF CI is is bad state.
We need to wait for it to be fixed before merging this change

@eolivelli
Copy link
Contributor

rebuild java8
run bookkeeper-server bookie tests
run bookkeeper-server replication tests

@eolivelli
Copy link
Contributor

rebuild java8

@eolivelli
Copy link
Contributor

run bookkeeper-server bookie tests
run bookkeeper-server replication tests

@ivankelly ivankelly added this to the 4.10.0 milestone Oct 23, 2019
@ivankelly ivankelly merged commit 4f56edf into apache:master Oct 23, 2019
ivankelly added a commit that referenced this pull request Oct 23, 2019
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 <eolivelli@gmail.com>

This closes #2185 from ivankelly/orphan-reader
(cherry picked from commit 4f56edf)

Signed-off-by: Ivan Kelly <ivank@apache.org>
ivankelly added a commit that referenced this pull request Oct 23, 2019
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 <eolivelli@gmail.com>

This closes #2185 from ivankelly/orphan-reader
(cherry picked from commit 4f56edf)

Signed-off-by: Ivan Kelly <ivank@apache.org>
zymap pushed a commit to streamnative/bookkeeper-achieved that referenced this pull request May 15, 2020
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 <eolivelli@gmail.com>

This closes apache#2185 from ivankelly/orphan-reader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants