Github user tgravescs commented on a diff in the pull request: https://github.com/apache/spark/pull/14079#discussion_r70846432 --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala --- @@ -800,6 +827,75 @@ private[spark] class TaskSetManager( maybeFinishTaskSet() } + private[scheduler] def updateBlacklistForFailedTask( + host: String, + exec: String, + index: Int): Unit = { + val failureStatus = execToFailures.getOrElseUpdate(exec, new FailureStatus()) + 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 failuresOnHost = (for { + exec <- sched.getExecutorsAliveOnHost(host).getOrElse(Set()).toSeq + failures <- execToFailures.get(exec) + } yield { + if (failures.tasksWithFailures.contains(index)) 1 else 0 + }).sum + if (failuresOnHost >= MAX_TASK_FAILURES_PER_NODE) { + nodeBlacklistedTasks.getOrElseUpdate(host, new HashSet()) += index + } + + if (failureStatus.totalFailures >= MAX_FAILURES_PER_EXEC_STAGE) { + // This executor has been pushed into the blacklist for this stage. Let's check if it pushes + // the whole node into the blacklist + val blacklistedExecutors = + execToFailures.filter(_._2.totalFailures >= MAX_FAILURES_PER_EXEC_STAGE) + if (blacklistedExecutors.size >= MAX_FAILED_EXEC_PER_NODE_STAGE) { --- End diff -- not sure it matters to much here other then user information but if a node is already blacklisted, it could keep printing the info and adding it to the blacklistedNodes list. I'm seeing this when one node fails that has a bunch of tasks running on it and all the tasks fail very quickly.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org