Github user kayousterhout commented on a diff in the pull request:
https://github.com/apache/spark/pull/14079#discussion_r72535896
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala ---
@@ -310,12 +342,38 @@ private[spark] class TaskSchedulerImpl(
}
}
- // Randomly shuffle offers to avoid always placing tasks on the same
set of workers.
- val shuffledOffers = Random.shuffle(offers)
+ // ensure that we periodically check if executors can be removed from
the blacklist, without
+ // requiring a separate thread and added synchronization overhead
+ blacklistTracker.expireExecutorsInBlacklist()
+
+ val sortedTaskSets = rootPool.getSortedTaskSetQueue
+ val filteredOffers: IndexedSeq[WorkerOffer] = offers.filter { offer =>
+ !blacklistTracker.isNodeBlacklisted(offer.host) &&
+ !blacklistTracker.isExecutorBlacklisted(offer.executorId)
+ } match {
+ // toIndexedSeq always makes an *immutable* IndexedSeq, though we
don't care if its mutable
+ // or immutable. So we do this to avoid making a pointless copy
+ case is: IndexedSeq[WorkerOffer] => is
+ case other: Seq[WorkerOffer] => other.toIndexedSeq
+ }
--- End diff --
Would you mind moving this to a separate PR? A lot of complexity here
already, and that seems like an important change to document / see clearly in
future git-blames. I can quickly review to get that in ASAP.
---
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]