Github user JonathanTaws commented on a diff in the pull request: https://github.com/apache/spark/pull/15405#discussion_r82673637 --- Diff: core/src/main/scala/org/apache/spark/deploy/master/Master.scala --- @@ -637,6 +637,16 @@ private[deploy] class Master( } freeWorkers = freeWorkers.filter(canLaunchExecutor) } + + val numExecutorsScheduled = assignedExecutors.sum + val numExecutorsLaunched = app.executors.size + // Check to see if we managed to launch the requested number of executors + if(numUsable != 0 && numExecutorsLaunched != app.executorLimit && + numExecutorsScheduled != app.executorLimit) { --- End diff -- `numExecutorsLaunched` corresponds to the actual number of executors that have been launched so far (literally that have been registered in the executors list in the ApplicationInfo), whereas `numExecutorsScheduled` corresponds to the number of executors that have been scheduled/allocated by `scheduleExecutorsOnWorkers`. This is needed because `scheduleExecutorsOnWorkers` is called multiple times when setting up the executors, and if we don't check the condition we will log repeatedly the same message but with incorrect information (such as "0 executors launched" even though the executors have been launched previously). Tell me if that doesn't make sense, I did a lot of trial and error until coming up with this condition.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org