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

    https://github.com/apache/spark/pull/14079#discussion_r72539148
  
    --- 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
    --- End diff --
    
    I always prefer map to yield (but maybe I'm in the minority, in which case 
leave it?):
    
    execsWithFailuresOnNode.map {
      val failures = execToFailures.get(_)
      if (failures.tasksWithFailures.contains(index))
         1
      else
        0
    }.sum


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