Skip to content

Commit

Permalink
YARN-10997. Revisit allocation and reservation logging. Contributed b…
Browse files Browse the repository at this point in the history
…y Andras Gyori

(cherry picked from commit 7cb887e)
  • Loading branch information
szilard-nemeth authored and Eric Payne committed Jul 7, 2022
1 parent c617da1 commit 5d96646
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2608,13 +2608,11 @@ public void tryCommit(Resource cluster, ResourceCommitRequest r) {
long commitSuccess = System.nanoTime() - commitStart;
CapacitySchedulerMetrics.getMetrics()
.addCommitSuccess(commitSuccess);
LOG.info("Allocation proposal accepted");
isSuccess = true;
} else{
long commitFailed = System.nanoTime() - commitStart;
CapacitySchedulerMetrics.getMetrics()
.addCommitFailure(commitFailed);
LOG.info("Failed to accept allocation proposal");
}

if (LOG.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ private boolean commonCheckContainerAllocation(
// adding NP check as this proposal could not be allocated from reserved
// container in async-scheduling mode
if (allocation.getAllocateFromReservedContainer() == null) {
LOG.debug("Trying to allocate from reserved container in async scheduling mode");
return false;
}
RMContainer fromReservedContainer =
Expand Down Expand Up @@ -536,6 +537,8 @@ public boolean apply(Resource cluster,
// request without locking the scheduler, hence we need to check
if (getOutstandingAsksCount(schedulerContainer.getSchedulerRequestKey())
<= 0) {
LOG.debug("Rejecting appliance of allocation due to existing pending allocation " +
"request for " + schedulerContainer);
return false;
}

Expand Down Expand Up @@ -617,10 +620,12 @@ public boolean apply(Resource cluster,
schedulerContainer.getRmContainer().getContainer(),
reReservation);

LOG.info("Reserved container=" + rmContainer.getContainerId()
+ ", on node=" + schedulerContainer.getSchedulerNode()
+ " with resource=" + rmContainer
.getAllocatedOrReservedResource());
if (LOG.isDebugEnabled()) {
LOG.debug("Reserved container=" + rmContainer.getContainerId()
+ ", on node=" + schedulerContainer.getSchedulerNode()
+ " with resource=" + rmContainer
.getAllocatedOrReservedResource());
}
}
}
} finally {
Expand Down

0 comments on commit 5d96646

Please sign in to comment.