Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/7532#discussion_r35018150
--- Diff: core/src/main/scala/org/apache/spark/deploy/master/Master.scala
---
@@ -762,6 +789,86 @@ private[master] class Master(
}
/**
+ * Handle a request from an application to set the executors limit for
this application.
+ * @return whether the application has previously registered with this
Master.
+ */
+ private def handleRequestExecutors(appId: String, requestedTotal: Int):
Boolean = {
+ idToApp.get(appId) match {
+ case Some(appInfo) =>
+ logInfo(s"Application $appId requested to set total executors to
$requestedTotal.")
+ appInfo.executorLimit = requestedTotal
+
+ // We may have previously added workers to the blacklist. Now that
the application
+ // explicitly requests more executors, we can fulfill the request
by removing workers
+ // from the blacklist, if any.
+ if (appInfo.desc.coresPerExecutor.isEmpty) {
+ val numMissingExecutors = appInfo.executorLimit -
appInfo.executors.size
+ if (numMissingExecutors > 0) {
+ appInfo.blacklistedWorkers.take(numMissingExecutors).foreach {
workerId =>
--- End diff --
yes, it's OK for `numMissingExecutors > blacklistedWorkers`. In that case
we just remove everything from the blacklist. Imagine the case where we have 5
workers (each has 1 executor), then we kill two executors and add their workers
to the blacklist. Now if I request 10 extra executors, then 10 > 2 and
everything from my blacklist is removed such that we launch executors again,
which is what I want.
Does that answer your question?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]