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



##########
File path: 
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java
##########
@@ -1430,6 +1430,13 @@ private SelectHostResult selectHost(TaskInfo request, 
Map<String, List<NodeInfo>
         boolean requestedHostsWillBecomeAvailable = false;
         for (String host : requestedHosts) {
           prefHostCount++;
+
+          // Check if the host is removed from the registry after 
availableHostMap is created.
+          Set<LlapServiceInstance> activeInstancesByHost = 
activeInstances.getByHost(host);
+          if (activeInstancesByHost == null || 
activeInstancesByHost.isEmpty()) {
+            continue;
+          }
+
           // Pick the first host always. Weak attempt at cache affinity.
           if (availableHostMap.containsKey(host)) {

Review comment:
       I would avoid the continue statement above and modify the condition to:
   if (availableHostMap.containsKey(host) && activeInstancesByHost != null && 
!activeInstancesByHost.isEmpty())




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