Sanil15 commented on a change in pull request #1219: SAMZA-2373: Container 
Placement Service (core functionality) for container move and restart
URL: https://github.com/apache/samza/pull/1219#discussion_r352922775
 
 

 ##########
 File path: 
samza-core/src/main/java/org/apache/samza/clustermanager/ContainerManager.java
 ##########
 @@ -143,9 +230,23 @@ void handleContainerLaunchFail(String processorId, String 
containerId, String pr
    * @param resourceRequestState state of request in {@link ContainerAllocator}
    */
   @VisibleForTesting
-  void handleExpiredRequestWithHostAffinityEnabled(String processorId, String 
preferredHost,
+  void handleExpiredRequestForControlActionOrHostAffinityEnabled(String 
processorId, String preferredHost,
       SamzaResourceRequest request, ContainerAllocator allocator, 
ResourceRequestState resourceRequestState) {
     boolean resourceAvailableOnAnyHost = 
allocator.hasAllocatedResource(ResourceRequestState.ANY_HOST);
+
+    if (hasActiveContainerPlacementAction(processorId)) {
+      resourceRequestState.cancelResourceRequest(request);
+      handleControlActionFailure(processorId, 
getPlacementActionMetadata(processorId).get(),
+          "failed the Control action because request for resources to 
ClusterManager expired");
+      return;
+    }
+
+    // Host affinity disabled wait for Resource manager to return resources
+    if (!hostAffinityEnabled) {
+      return;
+    }
 
 Review comment:
   Because this handles expired requests for container placement actions in 
Host affinity disabled too! in that case, you cannot wait forever for the 
requested resources to be returned

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