Github user zsxwing commented on a diff in the pull request: https://github.com/apache/spark/pull/11455#discussion_r54663122 --- Diff: core/src/main/scala/org/apache/spark/deploy/master/Master.scala --- @@ -346,19 +346,29 @@ private[deploy] class Master( logInfo("Worker has been re-registered: " + workerId) worker.state = WorkerState.ALIVE - val validExecutors = executors.filter(exec => idToApp.get(exec.appId).isDefined) + val (validExecutors, invalidExecutors) = + executors.partition(exec => idToApp.get(exec.appId).isDefined) for (exec <- validExecutors) { --- End diff -- `validExecutors` may contains executors launched after master sends `RegisteredWorker`. Then `app.addExecutor` and `worker.addExecutor` will be called twice. So I made them idempotent.
--- 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