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

tison pushed a commit to branch branch-3.7
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


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

commit 9218cff77ab36ab4137b94b462d926ee5dc12856
Author: 萧易客 <km...@live.com>
AuthorDate: Tue Oct 17 08:55:25 2023 +0800

     ZOOKEEPER-4710 Fix ZkUtil deleteInBatch() by releasing semaphore after set 
flag (#2020) (#2081)
    
    Co-authored-by: Yan Zhao <horizo...@apache.org>
---
 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 48ac142dc..6690d609f 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