From 7e3b5e6f5cb4945b4fab27e8a83d04280df50e17 Mon Sep 17 00:00:00 2001 From: Zhijie Shen Date: Tue, 21 Oct 2014 21:49:17 -0700 Subject: [PATCH] YARN-2721. Suppress NodeExist exception thrown by ZKRMStateStore when it retries creating znode. Contributed by Jian He. --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../yarn/server/resourcemanager/recovery/ZKRMStateStore.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index b638ab058a..4a71b6b664 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -717,6 +717,9 @@ Release 2.6.0 - UNRELEASED YARN-2720. Windows: Wildcard classpath variables not expanded against resources contained in archives. (Craig Welch via cnauroth) + YARN-2721. Suppress NodeExist exception thrown by ZKRMStateStore when it + retries creating znode. (Jian He via zjshen) + Release 2.5.1 - 2014-09-05 INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/ZKRMStateStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/ZKRMStateStore.java index 87c8cbe729..fdbf125b0f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/ZKRMStateStore.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/ZKRMStateStore.java @@ -1094,6 +1094,10 @@ T runWithRetries() throws Exception { throw new StoreFencedException(); } } catch (KeeperException ke) { + if (ke.code() == Code.NODEEXISTS) { + LOG.info("znode already exists!"); + return null; + } LOG.info("Exception while executing a ZK operation.", ke); if (shouldRetry(ke.code()) && ++retry < numRetries) { LOG.info("Retrying operation on ZK. Retry no. " + retry);