pgaref commented on a change in pull request #2645:
URL: https://github.com/apache/hive/pull/2645#discussion_r710209073



##########
File path: 
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java
##########
@@ -1447,23 +1454,26 @@ private SelectHostResult selectHost(TaskInfo request, 
Map<String, List<NodeInfo>
                 if (request.shouldForceLocality()) {
                   requestedHostsWillBecomeAvailable = true;
                 } else {
-                  LlapServiceInstance inst = 
activeInstances.getByHost(host).stream().findFirst().get();
-                  NodeInfo nodeInfo = 
instanceToNodeMap.get(inst.getWorkerIdentity());
-                  if (nodeInfo != null && nodeInfo.getEnableTime() > 
request.getLocalityDelayTimeout()
-                      && nodeInfo.isDisabled() && nodeInfo.hadCommFailure()) {
-                    LOG.debug("Host={} will not become available within 
requested timeout", nodeInfo);
-                    // This node will likely be activated after the task 
timeout expires.
-                  } else {
-                    // Worth waiting for the timeout.
-                    requestedHostsWillBecomeAvailable = true;
+                  for (LlapServiceInstance inst : activeInstancesByHost) {
+                    NodeInfo nodeInfo = 
instanceToNodeMap.get(inst.getWorkerIdentity());
+                    if (nodeInfo == null) {
+                      LOG.warn("Null NodeInfo when attempting to get host {}", 
host);
+                      // Leave requestedHostWillBecomeAvailable as is. If some 
other host is found - delay,
+                      // else ends up allocating to a random host immediately.
+                      continue;

Review comment:
       we can avoid continue by changing second if to else if




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to