Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2433#discussion_r173216785
--- Diff:
storm-client/src/jvm/org/apache/storm/grouping/LoadAwareShuffleGrouping.java ---
@@ -295,7 +295,11 @@ private Scope calculateScope(Map<Integer, NodeInfo>
taskToNodePort, Map<String,
private Map<String, String> getHostToRackMapping(Map<Integer,
NodeInfo> taskToNodePort) {
Set<String> hosts = new HashSet();
for (int task: targetTasks) {
- hosts.add(taskToNodePort.get(task).get_node());
+ //if this task containing worker will be killed by a
assignments sync,
+ //taskToNodePort will be an empty map which is refreshed by
WorkerState
+ if (taskToNodePort.containsKey(task)) {
+ hosts.add(taskToNodePort.get(task).get_node());
+ }
--- End diff --
Nit: could we log an error if it does not contain the task? I just want to
be sure that we know something possibly unexpected has happened here.
---