AngersZhuuuu commented on code in PR #43906:
URL: https://github.com/apache/spark/pull/43906#discussion_r1405592624
##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala:
##########
@@ -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()
Review Comment:
> @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
--
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]