hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jl...@apache.org
Subject hadoop git commit: YARN-4723. NodesListManager$UnknownNodeId ClassCastException. Contributed by Kuhu Shukla (cherry picked from commit 6b0f813e898cbd14b2ae52ecfed6d30bce8cb6b7)
Date Fri, 26 Feb 2016 20:26:49 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 6f5ca1b29 -> da9f00ac8


YARN-4723. NodesListManager$UnknownNodeId ClassCastException. Contributed by Kuhu Shukla
(cherry picked from commit 6b0f813e898cbd14b2ae52ecfed6d30bce8cb6b7)


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

Branch: refs/heads/branch-2.8
Commit: da9f00ac8bec60f4a626b16247887b2bc684091e
Parents: 6f5ca1b
Author: Jason Lowe <jlowe@apache.org>
Authored: Fri Feb 26 20:24:50 2016 +0000
Committer: Jason Lowe <jlowe@apache.org>
Committed: Fri Feb 26 20:26:31 2016 +0000

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                       |  3 +++
 .../yarn/server/resourcemanager/NodesListManager.java | 13 ++-----------
 .../server/resourcemanager/rmnode/RMNodeImpl.java     |  4 ++++
 .../server/resourcemanager/TestRMNodeTransitions.java | 14 ++++++++++++++
 4 files changed, 23 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/da9f00ac/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index c134f08..bc4fb4c 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -1318,6 +1318,9 @@ Release 2.7.3 - UNRELEASED
     YARN-2046. Out of band heartbeats are sent only on container kill and
     possibly too early (Ming Ma via jlowe)
 
+    YARN-4723. NodesListManager$UnknownNodeId ClassCastException (Kuhu Shukla
+    via jlowe)
+
 Release 2.7.2 - 2016-01-25
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/da9f00ac/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/NodesListManager.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/NodesListManager.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/NodesListManager.java
index 49706f3..89027b1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/NodesListManager.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/NodesListManager.java
@@ -165,17 +165,8 @@ public class NodesListManager extends CompositeService implements
       UnknownNodeId nodeId = new UnknownNodeId(host);
       RMNodeImpl rmNode = new RMNodeImpl(nodeId,
           rmContext, host, -1, -1, new UnknownNode(host), null, null);
-
-      RMNode prevRMNode =
-          rmContext.getRMNodes().putIfAbsent(nodeId, rmNode);
-      if (prevRMNode != null) {
-        this.rmContext.getDispatcher().getEventHandler().handle(
-            new RMNodeEvent(prevRMNode.getNodeID(),
-                RMNodeEventType.DECOMMISSION));
-      } else {
-        this.rmContext.getDispatcher().getEventHandler().handle(
-            new RMNodeEvent(nodeId, RMNodeEventType.DECOMMISSION));
-      }
+      rmContext.getInactiveRMNodes().put(nodeId, rmNode);
+      rmNode.handle(new RMNodeEvent(nodeId, RMNodeEventType.DECOMMISSION));
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/da9f00ac/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmnode/RMNodeImpl.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/rmnode/RMNodeImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmnode/RMNodeImpl.java
index 8bdc1b5..607e46c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmnode/RMNodeImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmnode/RMNodeImpl.java
@@ -1003,6 +1003,10 @@ public class RMNodeImpl implements RMNode, EventHandler<RMNodeEvent>
{
    */
   public static void deactivateNode(RMNodeImpl rmNode, NodeState finalState) {
 
+    if (rmNode.getNodeID().getPort() == -1) {
+      rmNode.updateMetricsForDeactivatedNode(rmNode.getState(), finalState);
+      return;
+    }
     reportNodeUnusable(rmNode, finalState);
 
     // Deactivate the node

http://git-wip-us.apache.org/repos/asf/hadoop/blob/da9f00ac/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMNodeTransitions.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMNodeTransitions.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMNodeTransitions.java
index 701e512..6ba360b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMNodeTransitions.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMNodeTransitions.java
@@ -688,6 +688,20 @@ public class TestRMNodeTransitions {
     Assert.assertEquals(0, node.getRunningApps().size());
   }
 
+  @Test
+  public void testUnknownNodeId() {
+    NodesListManager.UnknownNodeId nodeId =
+        new NodesListManager.UnknownNodeId("host1");
+    RMNodeImpl node =
+        new RMNodeImpl(nodeId, rmContext, null, 0, 0, null, null, null);
+    rmContext.getInactiveRMNodes().putIfAbsent(nodeId,node);
+    node.handle(
+        new RMNodeEvent(node.getNodeID(), RMNodeEventType.DECOMMISSION));
+    Assert.assertNull(
+        "Must be null as there is no NODE_UNUSABLE update",
+        nodesListManagerEvent);
+  }
+
   private RMNodeImpl getRunningNode() {
     return getRunningNode(null, 0);
   }


Mime
View raw message