You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2021/06/02 10:35:30 UTC
[pulsar] branch branch-2.7 updated (bc6668b -> e7c1e40)
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a change to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git.
from bc6668b Update version to 2.7.3-SNAPSHOT
new 3bf7649 [ML] Cancel scheduled tasks as the first step in closing (#10739)
new 4372b49 [ML] Fix solution for preventing race conditions between timeout and completion (#10740)
new e7c1e40 Release OpAddEntry.data when entry is copied and discarded (#10773)
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java | 10 ++++++----
.../java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
[pulsar] 02/03: [ML] Fix solution for preventing race conditions
between timeout and completion (#10740)
Posted by lh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 4372b491c806b6dbd7b98b23ecaca1decfdac5f1
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Fri May 28 22:25:38 2021 +0300
[ML] Fix solution for preventing race conditions between timeout and completion (#10740)
- solution was added in #4455
---
.../src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java
index 78ad312..37e9f35 100644
--- a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java
+++ b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java
@@ -230,7 +230,7 @@ class OpAddEntry extends SafeRunnable implements AddCallback, CloseCallback {
*/
private boolean checkAndCompleteOp(Object ctx) {
long addOpCount = (ctx instanceof Long) ? (long) ctx : -1;
- if (addOpCount != -1 && ADD_OP_COUNT_UPDATER.compareAndSet(this, this.addOpCount, -1)) {
+ if (addOpCount != -1 && ADD_OP_COUNT_UPDATER.compareAndSet(this, addOpCount, -1)) {
return true;
}
log.info("Add-entry already completed for {}-{}", ledger != null ? ledger.getId() : -1, entryId);
[pulsar] 03/03: Release OpAddEntry.data when entry is copied and
discarded (#10773)
Posted by lh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit e7c1e40d41ab222de4c848718ffdd5739c951fa2
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Wed Jun 2 05:38:22 2021 +0300
Release OpAddEntry.data when entry is copied and discarded (#10773)
Fixes #10738
There's a ByteBuf leak that happens in ledger rollover. The repro case in #10738 reproduces some Netty ByteBuf leaks that are detected by the Netty Leak detector.
Release `OpAddEntry.data` when the original entry is copied and discarded
This PR was split out of PR #10755 which was closed without merging.
---
.../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 7b0ae90..e3b83cc 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
@@ -1399,6 +1399,8 @@ public class ManagedLedgerImpl implements ManagedLedger, CreateCallback {
if (existsOp.ledger != null) {
existsOp.close();
existsOp = OpAddEntry.create(existsOp.ml, existsOp.data, existsOp.callback, existsOp.ctx);
+ // release the extra retain
+ ReferenceCountUtil.release(existsOp.data);
}
existsOp.setLedger(currentLedger);
pendingAddEntries.add(existsOp);
[pulsar] 01/03: [ML] Cancel scheduled tasks as the first step in
closing (#10739)
Posted by lh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 3bf7649dcf3b0d509c6473b91fdd09ed4652dfdc
Author: Lari Hotari <lh...@apache.org>
AuthorDate: Wed Jun 2 13:28:47 2021 +0300
[ML] Cancel scheduled tasks as the first step in closing (#10739)
- when currentLedger was null, the scheduled tasks wouldn't get cancelled
---
.../org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
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 d50ab92..7b0ae90 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
@@ -1212,6 +1212,10 @@ public class ManagedLedgerImpl implements ManagedLedger, CreateCallback {
factory.close(this);
STATE_UPDATER.set(this, State.Closed);
+ if (this.timeoutTask != null) {
+ this.timeoutTask.cancel(false);
+ }
+
LedgerHandle lh = currentLedger;
if (lh == null) {
@@ -1242,10 +1246,6 @@ public class ManagedLedgerImpl implements ManagedLedger, CreateCallback {
closeAllCursors(callback, ctx);
}, null);
- if (this.timeoutTask != null) {
- this.timeoutTask.cancel(false);
- }
-
}
private void closeAllCursors(CloseCallback callback, final Object ctx) {