YARN-4723. NodesListManager$UnknownNodeId ClassCastException. Contributed by Kuhu Shukla
(cherry picked from commit 6b0f813e89
)
This commit is contained in:
parent
6f5ca1b293
commit
da9f00ac8b
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue