From a65c3ea91cad7e8b453976bab2165ea4a3c6daf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Elek?= Date: Sat, 15 Sep 2018 13:35:00 +0200 Subject: [PATCH] HDDS-449. Add a NULL check to protect DeadNodeHandler#onMessage. Contributed by LiXin Ge. --- .../org/apache/hadoop/hdds/scm/node/DeadNodeHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DeadNodeHandler.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DeadNodeHandler.java index d694a103a69..7fda67d9af2 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DeadNodeHandler.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DeadNodeHandler.java @@ -57,6 +57,11 @@ public class DeadNodeHandler implements EventHandler { EventPublisher publisher) { Set 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());