XComp commented on a change in pull request #18869:
URL: https://github.com/apache/flink/pull/18869#discussion_r813923960
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java
##########
@@ -474,13 +515,22 @@ public void releaseAndTryRemoveAll() throws Exception {
@Override
public void release(String pathInZooKeeper) throws Exception {
final String path = normalizePath(pathInZooKeeper);
+ final String lockPath = getLockPath(path);
try {
- client.delete().forPath(getLockPath(path));
- } catch (KeeperException.NoNodeException ignored) {
- // we have never locked this node
+ deleteIdempotently(lockPath);
} catch (Exception e) {
- throw new Exception(
- "Could not release the lock: " +
getLockPath(pathInZooKeeper) + '.', e);
+ throw new Exception("Could not release the lock: " + lockPath +
'.', e);
+ }
+ }
+
+ private void deleteIdempotently(String path) throws Exception {
Review comment:
I like that. It's probably more descriptive than the
`deleteIdempotently` method name 👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]