Github user advancedxy commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18492#discussion_r181706342
  
    --- Diff: 
core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala ---
    @@ -373,8 +373,14 @@ private[spark] class ExecutorAllocationManager(
         // If our target has not changed, do not send a message
         // to the cluster manager and reset our exponential growth
         if (delta == 0) {
    -      numExecutorsToAdd = 1
    -      return 0
    +      // Check if there is any speculative jobs pending
    +      if (listener.pendingTasks == 0 && listener.pendingSpeculativeTasks > 
0) {
    +        numExecutorsTarget =
    +          math.max(math.min(maxNumExecutorsNeeded + 1, maxNumExecutors), 
minNumExecutors)
    --- End diff --
    
    Same here. 
    `maxNumExecutorsNeeded + 1` doesn't quite make sense.
    @janewangfb could you please post/update some comments here? And I wonder 
why we didn't take `pendingSpeculativeTasks` into account when calculating 
`maxNumExecutorsNeeded()`
    
    Or @jerryshao, do you know the rationale?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to