hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From naganarasimha...@apache.org
Subject hadoop git commit: YARN-5921. Incorrect synchronization in RMContextImpl#setHAServiceState/getHAServiceState. Contributed by Varun Saxena
Date Thu, 08 Dec 2016 02:14:56 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 7dc22dbe0 -> 5b44b0c9e


YARN-5921. Incorrect synchronization in RMContextImpl#setHAServiceState/getHAServiceState.
Contributed by Varun Saxena

(cherry picked from commit f3b8ff54ab08545d7093bf8861b44ec9912e8dc3)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5b44b0c9
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5b44b0c9
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5b44b0c9

Branch: refs/heads/branch-2.8
Commit: 5b44b0c9edb16e79c581a121806547f8346e2128
Parents: 7dc22db
Author: Naganarasimha <naganarasimha_gr@apache.org>
Authored: Tue Dec 6 06:53:38 2016 +0530
Committer: Naganarasimha <naganarasimha_gr@apache.org>
Committed: Thu Dec 8 07:37:12 2016 +0530

----------------------------------------------------------------------
 .../hadoop/yarn/server/resourcemanager/RMContextImpl.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5b44b0c9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMContextImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMContextImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMContextImpl.java
index ed9942b..a549930 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMContextImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMContextImpl.java
@@ -73,6 +73,8 @@ public class RMContextImpl implements RMContext {
   private RMApplicationHistoryWriter rmApplicationHistoryWriter;
   private SystemMetricsPublisher systemMetricsPublisher;
 
+  private final Object haServiceStateLock = new Object();
+
   /**
    * Default constructor. To be used in conjunction with setter methods for
    * individual fields.
@@ -237,9 +239,9 @@ public class RMContextImpl implements RMContext {
     this.isHAEnabled = isHAEnabled;
   }
 
-  void setHAServiceState(HAServiceState haServiceState) {
-    synchronized (haServiceState) {
-      this.haServiceState = haServiceState;
+  void setHAServiceState(HAServiceState serviceState) {
+    synchronized (haServiceStateLock) {
+      this.haServiceState = serviceState;
     }
   }
 
@@ -335,7 +337,7 @@ public class RMContextImpl implements RMContext {
 
   @Override
   public HAServiceState getHAServiceState() {
-    synchronized (haServiceState) {
+    synchronized (haServiceStateLock) {
       return haServiceState;
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message