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

    https://github.com/apache/spark/pull/14079#discussion_r70727301
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -611,16 +614,32 @@ private[spark] class TaskSetManager(
     
         // If no executors have registered yet, don't abort the stage, just 
wait.  We probably
         // got here because a task set was added before the executors 
registered.
    -    if (executors.nonEmpty) {
    +    if (executorsByHost.nonEmpty) {
           // take any task that needs to be scheduled, and see if we can find 
some executor it *could*
           // run on
    -      pendingTask.foreach { taskId =>
    -        if (executors.forall(executorIsBlacklisted(_, taskId))) {
    -          val execs = executors.toIndexedSeq.sorted.mkString("(", ",", ")")
    -          val partition = tasks(taskId).partitionId
    -          abort(s"Aborting ${taskSet} because task $taskId (partition 
$partition)" +
    -            s" has already failed on executors $execs, and no other 
executors are available.")
    +      pendingTask.foreach { indexInTaskSet =>
    +        val stage = taskSet.stageId
    +        executorsByHost.foreach { case (host, execs) =>
    +          if (!blacklist.isNodeBlacklisted(host) &&
    +                !isNodeBlacklistedForTaskSet(host) &&
    +                !isNodeBlacklistedForTask(host, indexInTaskSet)) {
    +            execs.foreach { exec =>
    +              if (
    +                !blacklist.isExecutorBlacklisted(exec) &&
    +                  !isExecutorBlacklistedForTaskSet(exec) &&
    +                  !isExecutorBlacklistedForTask(exec, indexInTaskSet)
    +              ) {
    +                // we've found some executor this task can run on.  Its 
possible that some *other*
    +                // task isn't schedulable anywhere, but we will discover 
that in some later call,
    +                // when that unschedulable task is the last task remaining.
    +                return
    --- End diff --
    
    Another case of using `execs.exists`?


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