shameersss1 commented on code in PR #7744:
URL: https://github.com/apache/hadoop/pull/7744#discussion_r2210914769


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AbstractYarnScheduler.java:
##########
@@ -692,8 +692,8 @@ protected void 
autoCorrectContainerAllocation(List<ResourceRequest> resourceRequ
               request.getCapability());
       int numContainerAllocated = 
allocatedContainerMap.getOrDefault(containerObjectType,
           Collections.emptyList()).size();
-      if (numContainerAllocated > 0) {
-        int numContainerAsk = request.getNumContainers();
+      int numContainerAsk = request.getNumContainers();
+      if (numContainerAllocated > 0 && numContainerAsk > 0) {

Review Comment:
   When AM’s AskList has its container count set to 0 , This indicates that AM 
no longer need any containers. Isn't it safe to RELEASE all the allocated 
container in that case ? (Which is what the code is doing) ?
   
   Even if the allocated containers are set to AM, They AM may choose to not 
use it or release it back



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to