Github user sryza commented on a diff in the pull request: https://github.com/apache/spark/pull/6394#discussion_r31973076 --- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala --- @@ -225,12 +243,74 @@ private[yarn] class YarnAllocator( logInfo(s"Will request $missing executor containers, each with ${resource.getVirtualCores} " + s"cores and ${resource.getMemory} MB memory including $memoryOverhead MB overhead") - for (i <- 0 until missing) { - val request = createContainerRequest(resource) - amClient.addContainerRequest(request) - val nodes = request.getNodes - val hostStr = if (nodes == null || nodes.isEmpty) "Any" else nodes.last - logInfo(s"Container request (host: $hostStr, capability: $resource)") + // Calculated the number of executors we expected to satisfy all the preferred locality tasks --- End diff -- One possible issue with the approach here is that our locality preferences might shift when a stage completes and a new stage comes in. If we have a set of outstanding requests, it would be nice if we could cancel requests for the locations that we no longer need and place our requests on nodes that we now care about. One way we could achieve this is, each time we call `updateResourceRequsts` remove all the unsatisfied container requests from amClient and resubmit requests based on our current needs. I.e., after removal, missing would always be `targetNumExecutors - numExecutorsRunning`.
--- 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