Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

int updatedContainerRequest = numContainerAsk - numContainerAllocated;
if (updatedContainerRequest < 0) {
// add an entry to extra allocated map
Expand Down