You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/07/15 22:21:28 UTC

[GitHub] [hadoop] xiaoyuyao commented on a change in pull request #1094: HDDS-1787. NPE thrown while trying to find DN closest to client.

xiaoyuyao commented on a change in pull request #1094: HDDS-1787. NPE thrown while trying to find DN closest to client.
URL: https://github.com/apache/hadoop/pull/1094#discussion_r303661158
 
 

 ##########
 File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMBlockProtocolServer.java
 ##########
 @@ -290,7 +290,12 @@ public ScmInfo getScmInfo() throws IOException {
       NodeManager nodeManager = scm.getScmNodeManager();
       Node client = nodeManager.getNode(clientMachine);
       List<Node> nodeList = new ArrayList();
-      nodes.stream().forEach(path -> nodeList.add(nodeManager.getNode(path)));
+      nodes.stream().forEach(path -> {
+        DatanodeDetails node = nodeManager.getNode(path);
+        if (node != null) {
 
 Review comment:
   Can you elaborate the case nodeManager.getNode() gives back null? Can we add a WARN log for the case?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org