From a4ba6c85255dbb1d7dae4072db581c043e494dec Mon Sep 17 00:00:00 2001 From: Wangda Tan Date: Tue, 8 Dec 2015 14:25:16 -0800 Subject: [PATCH] YARN-4424. Fix deadlock in RMAppImpl. (Jian he via wangda) (cherry picked from commit 7e4715186d31ac889fba26d453feedcebb11fc70) Conflicts: hadoop-yarn-project/CHANGES.txt (cherry picked from commit 7013f9d6cda88e72a839b1c55757615b55101beb) Conflicts: hadoop-yarn-project/CHANGES.txt --- hadoop-yarn-project/CHANGES.txt | 2 ++ .../resourcemanager/rmapp/RMAppImpl.java | 22 +++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 1764fc34dac..412999f4d0f 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -2000,6 +2000,8 @@ Release 2.6.3 - UNRELEASED YARN-4434. NodeManager Disk Checker parameter documentation is not correct. (Weiwei Yang via aajisaka) + YARN-4424. Fix deadlock in RMAppImpl. (Jian he via wangda) + Release 2.6.2 - 2015-10-28 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/rmapp/RMAppImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java index b1a5814081b..7a2b717cc73 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java @@ -490,21 +490,15 @@ public class RMAppImpl implements RMApp, Recoverable { @Override public FinalApplicationStatus getFinalApplicationStatus() { - this.readLock.lock(); - try { - // finish state is obtained based on the state machine's current state - // as a fall-back in case the application has not been unregistered - // ( or if the app never unregistered itself ) - // when the report is requested - if (currentAttempt != null - && currentAttempt.getFinalApplicationStatus() != null) { - return currentAttempt.getFinalApplicationStatus(); - } - return - createFinalApplicationStatus(this.stateMachine.getCurrentState()); - } finally { - this.readLock.unlock(); + // finish state is obtained based on the state machine's current state + // as a fall-back in case the application has not been unregistered + // ( or if the app never unregistered itself ) + // when the report is requested + if (currentAttempt != null + && currentAttempt.getFinalApplicationStatus() != null) { + return currentAttempt.getFinalApplicationStatus(); } + return createFinalApplicationStatus(this.stateMachine.getCurrentState()); } @Override