HDDS-449. Add a NULL check to protect DeadNodeHandler#onMessage. Contributed by LiXin Ge.

This commit is contained in:
Márton Elek 2018-09-15 13:35:00 +02:00
parent 985f3bf3fb
commit a65c3ea91c
1 changed files with 5 additions and 0 deletions

View File

@ -57,6 +57,11 @@ public void onMessage(DatanodeDetails datanodeDetails,
EventPublisher publisher) {
Set<ContainerID> containers =
node2ContainerMap.getContainers(datanodeDetails.getUuid());
if (containers == null) {
LOG.info("There's no containers in dead datanode {}, no replica will be"
+ " removed from the in-memory state.", datanodeDetails.getUuid());
return;
}
LOG.info(
"Datanode {} is dead. Removing replications from the in-memory state.",
datanodeDetails.getUuid());