TisonKun 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_r269498225
##########
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:
Correct.
----------------------------------------------------------------
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