YARN-2721. Suppress NodeExist exception thrown by ZKRMStateStore when it retries creating znode. Contributed by Jian He.

This commit is contained in:
Zhijie Shen 2014-10-21 21:49:17 -07:00
parent c0e034336c
commit 7e3b5e6f5c
2 changed files with 7 additions and 0 deletions

View File

@ -717,6 +717,9 @@ Release 2.6.0 - UNRELEASED
YARN-2720. Windows: Wildcard classpath variables not expanded against YARN-2720. Windows: Wildcard classpath variables not expanded against
resources contained in archives. (Craig Welch via cnauroth) 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 Release 2.5.1 - 2014-09-05
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -1094,6 +1094,10 @@ T runWithRetries() throws Exception {
throw new StoreFencedException(); throw new StoreFencedException();
} }
} catch (KeeperException ke) { } catch (KeeperException ke) {
if (ke.code() == Code.NODEEXISTS) {
LOG.info("znode already exists!");
return null;
}
LOG.info("Exception while executing a ZK operation.", ke); LOG.info("Exception while executing a ZK operation.", ke);
if (shouldRetry(ke.code()) && ++retry < numRetries) { if (shouldRetry(ke.code()) && ++retry < numRetries) {
LOG.info("Retrying operation on ZK. Retry no. " + retry); LOG.info("Retrying operation on ZK. Retry no. " + retry);