Sanil15 commented on a change in pull request #1170: Samza-2330: Handle expired 
resource request for Container allocator when host affinity is disabled 
URL: https://github.com/apache/samza/pull/1170#discussion_r332688439
 
 

 ##########
 File path: 
samza-core/src/main/java/org/apache/samza/clustermanager/ContainerAllocator.java
 ##########
 @@ -233,14 +231,15 @@ void assignResourceRequests() {
   }
 
   /**
-   * Handles an expired resource request when {@code hostAffinityEnabled} is 
true, in this case since the
-   * preferred host, we try to see if a surplus ANY_HOST is available in the 
request queue.
+   * Handles an expired resource request for both active and standby 
containers. Since a preferred host cannot be obtained
+   * this method checks the availability of surplus ANY_HOST resources and 
launches the container if available. Otherwise
+   * issues an ANY_HOST request. This behavior holds regardless of 
host-affinity enabled or not.
    */
   @VisibleForTesting
-  void handleExpiredRequestWithHostAffinityEnabled(String processorId, String 
preferredHost,
+  void handleExpiredRequest(String processorId, String preferredHost,
       SamzaResourceRequest request) {
     boolean resourceAvailableOnAnyHost = 
hasAllocatedResource(ResourceRequestState.ANY_HOST);
-    if (standbyContainerManager.isPresent()) {
+    if (hostAffinityEnabled && standbyContainerManager.isPresent()) {
 
 Review comment:
   sure

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