Skip to content

Commit 7696764

Browse files
vinayakumarbcnauroth
authored andcommitted
YARN-11839. [RM HA] - In corner case, RM stay in ACTIVE with RMStateStore in FENCED state
Closes #7999 Signed-off-by: Shilun Fan <[email protected]> Signed-off-by: Chris Nauroth <[email protected]> Signed-off-by: Ayush Saxena <[email protected]>
1 parent 2e9ef96 commit 7696764

File tree

1 file changed

+5
-1
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager

1 file changed

+5
-1
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,11 @@ protected void serviceStop() throws Exception {
12181218
* Transition to standby state in a new thread. The transition operation is
12191219
* asynchronous to avoid deadlock caused by cyclic dependency.
12201220
*/
1221-
private void handleTransitionToStandByInNewThread() {
1221+
private synchronized void handleTransitionToStandByInNewThread() {
1222+
if (rmContext.getHAServiceState() == HAServiceProtocol.HAServiceState.STANDBY) {
1223+
LOG.info("RM already in standby state");
1224+
return;
1225+
}
12221226
Thread standByTransitionThread =
12231227
new Thread(activeServices.standByTransitionRunnable);
12241228
standByTransitionThread.setName("StandByTransitionThread");

0 commit comments

Comments
 (0)