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 @@ -384,19 +384,25 @@ private[yarn] class YarnAllocator(
this.numLocalityAwareTasksPerResourceProfileId = numLocalityAwareTasksPerResourceProfileId
this.hostToLocalTaskCountPerResourceProfileId = hostToLocalTaskCountPerResourceProfileId

val res = resourceProfileToTotalExecs.map { case (rp, numExecs) =>
createYarnResourceForResourceProfile(rp)
if (numExecs != getOrUpdateTargetNumExecutorsForRPId(rp.id)) {
logInfo(s"Driver requested a total number of $numExecs executor(s) " +
s"for resource profile id: ${rp.id}.")
targetNumExecutorsPerResourceProfileId(rp.id) = numExecs
allocatorNodeHealthTracker.setSchedulerExcludedNodes(excludedNodes)
true
} else {
false
if (resourceProfileToTotalExecs.isEmpty) {
targetNumExecutorsPerResourceProfileId.clear()
Copy link
Contributor

Choose a reason for hiding this comment

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

@AngersZhuuuu Will it be better if we set values in targetNumExecutorsPerResourceProfileId to 0 instead of clearing targetNumExecutorsPerResourceProfileId.
ContainerRequests can be cancelled in YarnAllocator#updateResourceRequests if we set values to 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AngersZhuuuu Will it be better if we set values in targetNumExecutorsPerResourceProfileId to 0 instead of clearing targetNumExecutorsPerResourceProfileId. ContainerRequests can be cancelled in YarnAllocator#updateResourceRequests if we set values to 0.

Nice catch, will make a follower up pr later

allocatorNodeHealthTracker.setSchedulerExcludedNodes(excludedNodes)
true
} else {
val res = resourceProfileToTotalExecs.map { case (rp, numExecs) =>
createYarnResourceForResourceProfile(rp)
if (numExecs != getOrUpdateTargetNumExecutorsForRPId(rp.id)) {
logInfo(s"Driver requested a total number of $numExecs executor(s) " +
s"for resource profile id: ${rp.id}.")
targetNumExecutorsPerResourceProfileId(rp.id) = numExecs
allocatorNodeHealthTracker.setSchedulerExcludedNodes(excludedNodes)
true
} else {
false
}
}
res.exists(_ == true)
}
res.exists(_ == true)
}

/**
Expand Down