YARN-2992. ZKRMStateStore crashes due to session expiry. Contributed by Karthik Kambatla

(cherry picked from commit 1454efe5d4)

(cherry picked from commit ca0349b87a)
(cherry picked from commit 2f6be218fa41fd0f39633ec5ed0df6e0fa0f54b6)
This commit is contained in:
Jian He 2014-12-26 17:59:58 -08:00 committed by Vinod Kumar Vavilapalli
parent 8cdcb792a1
commit e7fc071906
2 changed files with 6 additions and 0 deletions

View File

@ -57,6 +57,9 @@ Release 2.6.1 - UNRELEASED
YARN-2340. Fixed NPE when queue is stopped during RM restart. YARN-2340. Fixed NPE when queue is stopped during RM restart.
(Rohith Sharmaks via jianhe) (Rohith Sharmaks via jianhe)
YARN-2992. ZKRMStateStore crashes due to session expiry. (Karthik Kambatla
via jianhe)
Release 2.6.0 - 2014-11-18 Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -1081,6 +1081,8 @@ public class ZKRMStateStore extends RMStateStore {
switch (code) { switch (code) {
case CONNECTIONLOSS: case CONNECTIONLOSS:
case OPERATIONTIMEOUT: case OPERATIONTIMEOUT:
case SESSIONEXPIRED:
case SESSIONMOVED:
return true; return true;
default: default:
break; break;
@ -1109,6 +1111,7 @@ public class ZKRMStateStore extends RMStateStore {
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);
Thread.sleep(zkRetryInterval); Thread.sleep(zkRetryInterval);
createConnection();
continue; continue;
} }
LOG.info("Maxed out ZK retries. Giving up!"); LOG.info("Maxed out ZK retries. Giving up!");