Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/13603#discussion_r69037911
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
@@ -576,6 +576,59 @@ private[spark] class TaskSetManager(
}
/**
+ * Check whether the given task set has been blacklisted to the point
that it can't run anywhere.
+ *
+ * It is possible that this taskset has become impossible to schedule
*anywhere* due to the
+ * blacklist. The most common scenario would be if there are fewer
executors than
+ * spark.task.maxFailures. We need to detect this so we can fail the
task set, otherwise the job
+ * will hang.
+ *
+ * There's a tradeoff here: we could make sure all tasks in the task set
are schedulable, but that
+ * would add extra time to each iteration of the scheduling loop. Here,
we take the approach of
+ * making sure at least one of the unscheduled tasks is schedulable.
This means we may not detect
+ * the hang as quickly as we could have, but we'll always detect the
hang eventually, and the
+ * method is faster in the typical case. In the worst case, this method
can take
+ * O(maxTaskFailures + numTasks) time, but it will be faster when there
haven't been any task
+ * failures (this is because the method picks on unscheduled task, and
then iterates through each
+ * executor until it finds one that the task hasn't failed on already).
+ */
+ private[scheduler] def abortIfCompletelyBlacklisted(executors:
Iterable[String]): Unit = {
+
+ def pendingTask: Option[Int] = {
--- End diff --
oh I didn't even know about lastIndexWhere! thanks, simpler, and despite
being a minor point I appreciate learning something new :)
sorry I think I just got on the wrong track in this while thinking about
doing the lazy-removal here as well, and when I decided against it never
stepped back to simplify it.
---
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]