You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by eo...@apache.org on 2021/05/28 19:26:32 UTC

[pulsar] branch master updated: [ML] Fix solution for preventing race conditions between timeout and completion (#10740)

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

eolivelli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 0237580  [ML] Fix solution for preventing race conditions between timeout and completion (#10740)
0237580 is described below

commit 0237580fde09ed39dcaae2a266ba87bbf2cfc9d4
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 5b4e198..c76d532 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
@@ -253,7 +253,7 @@ public class OpAddEntry extends SafeRunnable implements AddCallback, CloseCallba
      */
     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);