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
Date Fri, 26 Feb 2016 20:28:56 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.7 3bcca662b -> f68e1401b


YARN-4723. NodesListManager$UnknownNodeId ClassCastException. Contributed by Kuhu Shukla


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

Branch: refs/heads/branch-2.7
Commit: f68e1401b8936f49f69c4bf9b66e8f3c8c54991b
Parents: 3bcca66
Author: Jason Lowe <jlowe@apache.org>
Authored: Fri Feb 26 20:28:29 2016 +0000
Committer: Jason Lowe <jlowe@apache.org>
Committed: Fri Feb 26 20:28:29 2016 +0000

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


http://git-wip-us.apache.org/repos/asf/hadoop/blob/f68e1401/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index f0e44e5..02d283c 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -98,6 +98,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/f68e1401/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 b153b0f..46fb3af 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
@@ -143,17 +143,8 @@ public class NodesListManager extends AbstractService 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.getHost(), rmNode);
+      rmNode.handle(new RMNodeEvent(nodeId, RMNodeEventType.DECOMMISSION));
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f68e1401/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 673264f..3210524 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
@@ -743,6 +743,11 @@ public class RMNodeImpl implements RMNode, EventHandler<RMNodeEvent>
{
 
     @Override
     public void transition(RMNodeImpl rmNode, RMNodeEvent event) {
+      //check for UnknownNodeId
+      if (rmNode.getNodeID().getPort() == -1) {
+        rmNode.updateMetricsForDeactivatedNode(rmNode.getState(), finalState);
+        return;
+      }
       // Inform the scheduler
       rmNode.nodeUpdateQueue.clear();
       // If the current state is NodeState.UNHEALTHY

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f68e1401/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 c6da3fd..0735e0f 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
@@ -457,6 +457,20 @@ public class TestRMNodeTransitions {
     Assert.assertEquals(finishedAppId, hbrsp.getApplicationsToCleanup().get(0));
   }
 
+  @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.getHost(),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);
   }


Mime
View raw message