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/zookeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 77c1e4c87  ZOOKEEPER-4710 Fix ZkUtil deleteInBatch() by releasing 
semaphore after set flag (#2020)
77c1e4c87 is described below

commit 77c1e4c872e7ff09b71345edc67f176ed5e68380
Author: Yan Zhao <[email protected]>
AuthorDate: Fri Jun 23 19:42:24 2023 +0800

     ZOOKEEPER-4710 Fix ZkUtil deleteInBatch() by releasing semaphore after set 
flag (#2020)
---
 zookeeper-server/src/main/java/org/apache/zookeeper/ZKUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/ZKUtil.java 
b/zookeeper-server/src/main/java/org/apache/zookeeper/ZKUtil.java
index ae0f3b8a2..e149408dc 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/ZKUtil.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/ZKUtil.java
@@ -109,10 +109,10 @@ public class ZKUtil {
         List<Op> ops = new ArrayList<>();
         BatchedDeleteCbContext context = new BatchedDeleteCbContext(rateLimit);
         MultiCallback cb = (rc, path, ctx, opResults) -> {
-            ((BatchedDeleteCbContext) ctx).sem.release();
             if (rc != Code.OK.intValue()) {
                 ((BatchedDeleteCbContext) ctx).success.set(false);
             }
+            ((BatchedDeleteCbContext) ctx).sem.release();
         };
 
         // Delete the leaves first and eventually get rid of the root

Reply via email to