luoyuan3471 commented on code in PR #8752:
URL: https://github.com/apache/hadoop/pull/8752#discussion_r4677904447
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/RegularContainerAllocator.java:
##########
@@ -911,25 +914,30 @@ private ContainerAllocation allocate(Resource
clusterResource,
resourceLimits, schedulerKey, reservedContainer);
if (AllocationState.ALLOCATED == result.getAllocationState()) {
- result = doAllocation(result, node, schedulerKey, reservedContainer);
- break;
+ return doAllocation(result, node, schedulerKey, reservedContainer);
}
// In MultiNodePlacement, Try Allocate on other Available nodes
// from Iterator as well before Reserving. Else there won't be any
// Allocate of new containers when the first node in the
// iterator could not fit and returns RESERVED allocation.
if (AllocationState.RESERVED == result.getAllocationState()) {
- lastReservation = result;
- if (iter.hasNext()) {
+ if (nodeReservedContainer != null
+ && nodeReservedContainer != reservedContainer) {
+ // A new reservation cannot commit on an already-reserved node.
+ result = ContainerAllocation.PRIORITY_SKIPPED;
Review Comment:
Thanks for catching this, @gerashegalov. I added a debug log when the
allocator skips a conflicting reservation. Since assignContainer has already
recorded RESERVED, appending SKIPPED would leave both entries for the same
attempt. I’d prefer to address the app-activities reporting in a separate
change.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]