YARN-4723. NodesListManager$UnknownNodeId ClassCastException. Contributed by Kuhu Shukla
This commit is contained in:
parent
3bcca662bc
commit
f68e1401b8
|
@ -98,6 +98,9 @@ Release 2.7.3 - UNRELEASED
|
||||||
YARN-2046. Out of band heartbeats are sent only on container kill and
|
YARN-2046. Out of band heartbeats are sent only on container kill and
|
||||||
possibly too early (Ming Ma via jlowe)
|
possibly too early (Ming Ma via jlowe)
|
||||||
|
|
||||||
|
YARN-4723. NodesListManager$UnknownNodeId ClassCastException (Kuhu Shukla
|
||||||
|
via jlowe)
|
||||||
|
|
||||||
Release 2.7.2 - 2016-01-25
|
Release 2.7.2 - 2016-01-25
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -143,17 +143,8 @@ public class NodesListManager extends AbstractService implements
|
||||||
UnknownNodeId nodeId = new UnknownNodeId(host);
|
UnknownNodeId nodeId = new UnknownNodeId(host);
|
||||||
RMNodeImpl rmNode = new RMNodeImpl(nodeId,
|
RMNodeImpl rmNode = new RMNodeImpl(nodeId,
|
||||||
rmContext, host, -1, -1, new UnknownNode(host), null, null);
|
rmContext, host, -1, -1, new UnknownNode(host), null, null);
|
||||||
|
rmContext.getInactiveRMNodes().put(nodeId.getHost(), rmNode);
|
||||||
RMNode prevRMNode =
|
rmNode.handle(new RMNodeEvent(nodeId, RMNodeEventType.DECOMMISSION));
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -743,6 +743,11 @@ public class RMNodeImpl implements RMNode, EventHandler<RMNodeEvent> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void transition(RMNodeImpl rmNode, RMNodeEvent event) {
|
public void transition(RMNodeImpl rmNode, RMNodeEvent event) {
|
||||||
|
//check for UnknownNodeId
|
||||||
|
if (rmNode.getNodeID().getPort() == -1) {
|
||||||
|
rmNode.updateMetricsForDeactivatedNode(rmNode.getState(), finalState);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Inform the scheduler
|
// Inform the scheduler
|
||||||
rmNode.nodeUpdateQueue.clear();
|
rmNode.nodeUpdateQueue.clear();
|
||||||
// If the current state is NodeState.UNHEALTHY
|
// If the current state is NodeState.UNHEALTHY
|
||||||
|
|
|
@ -457,6 +457,20 @@ public class TestRMNodeTransitions {
|
||||||
Assert.assertEquals(finishedAppId, hbrsp.getApplicationsToCleanup().get(0));
|
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() {
|
private RMNodeImpl getRunningNode() {
|
||||||
return getRunningNode(null);
|
return getRunningNode(null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue