Github user squito commented on a diff in the pull request: https://github.com/apache/spark/pull/5636#discussion_r35801802 --- Diff: core/src/main/scala/org/apache/spark/scheduler/Stage.scala --- @@ -76,6 +76,34 @@ private[spark] abstract class Stage( */ private var _latestInfo: StageInfo = StageInfo.fromStage(this, nextAttemptId) + /** + * Spark is resilient to executors dying by retrying stages on FetchFailures. Here, we keep track + * of unique stage failures (per stage attempt) triggered by fetch failures to prevent endless + * stage retries. Specifically, per stage we wish to only record a failure when the following + * holds: + * + * A) A fetch failure was observed + * B) A failure has not yet been registered for this stage attempt. There may be multiple + * concurrent failures for a sinlge stage since we may have multiple tasks executing at the same + * time, one or many of which may fail. Also, even though there may only be one non-zombie stage + * attemp, zombie stages may still have running tasks. + */ + private val attemptsFailedFromFetch = new HashSet[Int] + + private[scheduler] def clearFailures() : Unit = { + attemptsFailedFromFetch.clear() + } + + /** + * Check whether we should abort the failedStage due to multiple failures. + * This method updates the running set of failed stage attempts and returns + * true if the number of failures exceeds the allowable number of failures. + */ + private[scheduler] def failAndShouldAbort(task: Task[_]): Boolean = { --- End diff -- maybe this should just take a `stageAttemptId` instead of a `task`? (sorry realize I am going back on an earlier request.) Also what do you think about changing the name to include "fetch failure" somhow, and also update the doc to be clear they are fetch failures?
--- 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