Jon Hall
Committed by Gerrit Code Review

Fix NPE caused by pushing events about nodes no longer in the cluster

Change-Id: I7a1da3d7824b07b446194d651ef4945f1305bce3
......@@ -258,6 +258,11 @@ public class DistributedClusterStore
private void notifyStateChange(NodeId nodeId, State oldState, State newState) {
if (oldState != newState) {
ControllerNode node = allNodes.get(nodeId);
// Either this node or that node is no longer part of the same cluster
if (node == null) {
log.warn("Could not find node {} in the cluster, ignoring state change", node);
return;
}
ClusterEvent.Type type = newState == State.READY ? INSTANCE_READY :
newState == State.ACTIVE ? INSTANCE_ACTIVATED :
INSTANCE_DEACTIVATED;
......@@ -378,4 +383,4 @@ public class DistributedClusterStore
log.warn(e.getMessage());
}
}
}
\ No newline at end of file
}
......