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_r365474245
##########
File path:
samza-core/src/main/java/org/apache/samza/clustermanager/ContainerManager.java
##########
@@ -143,9 +233,26 @@ void handleContainerLaunchFail(String processorId, String
containerId, String pr
* @param resourceRequestState state of request in {@link ContainerAllocator}
*/
@VisibleForTesting
- void handleExpiredRequestWithHostAffinityEnabled(String processorId, String
preferredHost,
+ void handleExpiredRequest(String processorId, String preferredHost,
SamzaResourceRequest request, ContainerAllocator allocator,
ResourceRequestState resourceRequestState) {
boolean resourceAvailableOnAnyHost =
allocator.hasAllocatedResource(ResourceRequestState.ANY_HOST);
+
+
+ // Case 1. Container placement actions can be taken in either cases of
host affinity being set, in both cases
+ // mark the control action failed
+ if (hasActiveContainerPlacementAction(processorId)) {
+ resourceRequestState.cancelResourceRequest(request);
+
markContainerPlacementActionFailed(getPlacementActionMetadata(processorId).get(),
+ "failed the Control action because request for resources to
ClusterManager expired");
+ return;
+ }
+
+ // Case 2. When host affinity is disabled wait for cluster resource
manager return resources
+ if (!hostAffinityEnabled) {
+ return;
+ }
Review comment:
added!
----------------------------------------------------------------
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