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

    https://github.com/apache/spark/pull/14079#discussion_r72539715
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -800,6 +832,78 @@ private[spark] class TaskSetManager(
         maybeFinishTaskSet()
       }
     
    +  private[scheduler] def updateBlacklistForFailedTask(
    +      host: String,
    +      exec: String,
    +      index: Int): Unit = {
    +    val failureStatus = execToFailures.getOrElseUpdate(exec, new 
FailureStatus(host))
    +    failureStatus.totalFailures += 1
    +    failureStatus.tasksWithFailures += index
    +
    +    // check if this task has also failed on other executors on the same 
host, and if so, blacklist
    +    // this task from the host
    +    val execsWithFailuresOnNode = 
nodesToExecsWithFailures.getOrElseUpdate(host, new HashSet())
    +    execsWithFailuresOnNode += exec
    +    val failuresOnHost = (for {
    +      exec <- execsWithFailuresOnNode.toIterator
    +      failures <- execToFailures.get(exec)
    +    } yield {
    +      if (failures.tasksWithFailures.contains(index)) 1 else 0
    +    }).sum
    +    if (failuresOnHost >= MAX_TASK_ATTEMPTS_PER_NODE) {
    +      nodeBlacklistedTasks.getOrElseUpdate(host, new HashSet()) += index
    +    }
    +
    +    if (failureStatus.totalFailures >= MAX_FAILURES_PER_EXEC_STAGE) {
    --- End diff --
    
    This logic seems to be repeated in at least one other place (where you 
first blacklist something on an executor, and then escalate the issue to the 
host). I wonder if there's a helper class that could be added that would handle 
this in both cases (i.e., for a specific task, and for a whole stage, and I 
think also for the app)? Maybe there's not enough shared logic?


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