Github user kayousterhout commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14079#discussion_r72536190
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala ---
    @@ -310,12 +343,41 @@ 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.foreach(_.expireExecutorsInBlacklist())
    +
    +    val sortedTaskSets = rootPool.getSortedTaskSetQueue
    +    val filteredOffers: IndexedSeq[WorkerOffer] = (blacklistTracker match {
    +      case Some(bl) => offers.filter { offer =>
    +        !bl.isNodeBlacklisted(offer.host) &&
    +          !bl.isExecutorBlacklisted(offer.executorId)
    +      }
    +      case None => offers
    +    }) 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
    +    }
    +    if (offers.nonEmpty && filteredOffers.isEmpty) {
    +      // Its possible that all the executors are now blacklisted, though 
we haven't aborted stages
    +      // during the check in resourceOfferSingleTaskSet.  If so, fail all 
existing task sets to
    +      // avoid unschedulability.
    +      if (areAllExecutorsBlacklisted()) {
    --- End diff --
    
    This is an optimization right? (it's not needed for correctness?)  If so, 
can we remove it? Worried about the complexity of all of this -- and this seems 
rare enough that the delta in time to failure isn't super important.


---
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]

Reply via email to