This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch branch-3.8
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
The following commit(s) were added to refs/heads/branch-3.8 by this push:
new 78e55c5af ZOOKEEPER-4710 Fix ZkUtil deleteInBatch() by releasing
semaphore after set flag (#2020) (#2080)
78e55c5af is described below
commit 78e55c5af3615633b8cdb78ce24f83cc1c248f81
Author: 萧易客 <[email protected]>
AuthorDate: Tue Oct 17 09:46:26 2023 +0800
ZOOKEEPER-4710 Fix ZkUtil deleteInBatch() by releasing semaphore after set
flag (#2020) (#2080)
Co-authored-by: Yan Zhao <[email protected]>
---
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 2ccdfc877..a76e2f63b 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