cloud-fan commented on a change in pull request #32306:
URL: https://github.com/apache/spark/pull/32306#discussion_r618935372



##########
File path: core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala
##########
@@ -290,11 +290,11 @@ private[spark] class ExecutorAllocationManager(
    * under the current load to satisfy all running and pending tasks, rounded 
up.
    */
   private[spark] def maxNumExecutorsNeededPerResourceProfile(rpId: Int): Int = 
{
-    val pending = listener.totalPendingTasksPerResourceProfile(rpId)
+    val pendingTask = listener.pendingTasksPerResourceProfile(rpId)
     val pendingSpeculative = 
listener.pendingSpeculativeTasksPerResourceProfile(rpId)
     val unschedulableTaskSets = 
listener.pendingUnschedulableTaskSetsPerResourceProfile(rpId)
     val running = listener.totalRunningTasksPerResourceProfile(rpId)
-    val numRunningOrPendingTasks = pending + running
+    val numRunningOrPendingTasks = pendingTask + pendingSpeculative + running

Review comment:
       previously `pending` is `pendingTasksPerResourceProfile(rp) + 
pendingSpeculativeTasksPerResourceProfile(rp)`, now we use 
`pendingTasksPerResourceProfile() + pendingSpeculative`, and 
`pendingSpeculative` simply calls 
`pendingSpeculativeTasksPerResourceProfile(...)`
   
   seems like a straightforward code clean up.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to