HeartSaVioR commented on a change in pull request #2998:  STORM-3379: Fix 
intermittent NPE during worker boot in local mode 
URL: https://github.com/apache/storm/pull/2998#discussion_r281021286
 
 

 ##########
 File path: storm-client/src/jvm/org/apache/storm/daemon/worker/WorkerState.java
 ##########
 @@ -393,14 +400,15 @@ public void refreshConnections() {
         Set<NodeInfo> newConnections = Sets.difference(neededConnections, 
currentConnections);
         Set<NodeInfo> removeConnections = Sets.difference(currentConnections, 
neededConnections);
 
+        Map<String, String> nodeHost = assignment != null ? 
assignment.get_node_host() : null;
         // Add new connections atomically
         cachedNodeToPortSocket.getAndUpdate(prev -> {
             Map<NodeInfo, IConnection> next = new HashMap<>(prev);
             for (NodeInfo nodeInfo : newConnections) {
                 next.put(nodeInfo,
                          mqContext.connect(
                              topologyId,
-                             
assignment.get_node_host().get(nodeInfo.get_node()),    // Host
+                             nodeHost.get(nodeInfo.get_node()),    // Host
 
 Review comment:
   That's OK once we make clear it doesn't throw NPE. Thanks for explaining 
here.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to