summaryrefslogtreecommitdiffstats
path: root/zkfacade
diff options
context:
space:
mode:
authorHarald Musum <musum@yahoo-inc.com>2017-03-31 09:05:39 +0200
committerHarald Musum <musum@yahoo-inc.com>2017-03-31 09:05:39 +0200
commit08aad8ea0956de6fd4e3013d943af271ba31ff1d (patch)
treeec5ce2931667502cf11fce1b1ab987cd18341cab /zkfacade
parent70aa236eade721b0d9fabdece9921c7d2069779e (diff)
Handle NoNodeException for notifyInternal
* This might happen if deploy prepare is returned successfully to client (majority of config servers have done prepare) and then client deletes application. The one config server that did not prepare will try to notify that it is finished but the path to the node it creates has gone when the application was deleted.
Diffstat (limited to 'zkfacade')
-rw-r--r--zkfacade/src/main/java/com/yahoo/vespa/curator/CuratorCompletionWaiter.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/curator/CuratorCompletionWaiter.java b/zkfacade/src/main/java/com/yahoo/vespa/curator/CuratorCompletionWaiter.java
index 69923c25998..7d9cbf3f41c 100644
--- a/zkfacade/src/main/java/com/yahoo/vespa/curator/CuratorCompletionWaiter.java
+++ b/zkfacade/src/main/java/com/yahoo/vespa/curator/CuratorCompletionWaiter.java
@@ -4,6 +4,7 @@ package com.yahoo.vespa.curator;
import com.yahoo.log.LogLevel;
import com.yahoo.path.Path;
import org.apache.curator.framework.CuratorFramework;
+import org.apache.zookeeper.KeeperException;
import java.time.Clock;
import java.time.Duration;
@@ -74,7 +75,18 @@ class CuratorCompletionWaiter implements Curator.CompletionWaiter {
}
private void notifyInternal() throws Exception {
- curator.create().forPath(myId);
+ try {
+ curator.create().forPath(myId);
+ } catch (RuntimeException e) {
+ // Throw only if we get something else than NoNodeException -- NoNodeException might happen when
+ // an application have been deleted and this method has not been called yet for the previous deployment
+ // on a minority of the config servers (see awaitInternal() method in this class)
+ if (e.getCause().getClass() != KeeperException.NoNodeException.class) {
+ throw e;
+ } else {
+ log.log(LogLevel.INFO, "Not able to notify completion at path: " + myId +", node has been deleted");
+ }
+ }
}
@Override