azagrebin commented on a change in pull request #8046: 
[FLINK-12006][coordination] Ensure owned znode deleted on 
ZooKeeperHaServices#deleteOwnedZNode
URL: https://github.com/apache/flink/pull/8046#discussion_r269485171
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/zookeeper/ZooKeeperHaServices.java
 ##########
 @@ -256,13 +256,14 @@ private void deleteOwnedZNode() throws Exception {
                // if there is a concurrent delete operation. Therefore we need 
to add this retry
                // logic. See https://issues.apache.org/jira/browse/CURATOR-430 
for more information.
                // The retry logic can be removed once we upgrade to Curator 
version >= 4.0.1.
-               boolean zNodeDeleted = false;
-               while (!zNodeDeleted) {
+               while (true) {
                        try {
-                               
client.delete().deletingChildrenIfNeeded().forPath("/");
-                               zNodeDeleted = true;
-                       } catch (KeeperException.NoNodeException ignored) {
-                               // concurrent delete operation. Try again.
+                               if (client.checkExists().forPath("/") != null) {
+                                       
client.delete().guaranteed().deletingChildrenIfNeeded().forPath("/");
 
 Review comment:
   Why do we need `guaranteed`? According to its comment, it just creates some 
background cleanup attempts if API call fails which does not seem to be the 
case here as there was no thrown exception. Do we not want rather to make sure 
everything has been deleted right here? Then we do not need to trigger any 
additional background cleanups to avoid other potential issues out of our 
control.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to