Github user CodingCat commented on a diff in the pull request:
https://github.com/apache/spark/pull/7532#discussion_r35018884
--- 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 --
thanks for answering, but if so, why we have to `blacklist` the workers?
Upon I request more resources, the `just-released` workers will be taken
again...
my second thought is that even `numMissingExecutors > blacklistedWorkers`,
can we ensure that the `numMissingExecutors` executor IDs we take from
blacklist are the earliest ones we push into the HashSet? (I think no, since
it's a HashSet)
---
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]