Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/5636#discussion_r35693174
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala ---
@@ -473,6 +473,319 @@ class DAGSchedulerSuite
assertDataStructuresEmpty()
}
+ // Helper function to validate state when creating tests for task
failures
+ def checkStageId(stageId: Int, attempt: Int, stageAttempt: TaskSet) {
+ assert(stageAttempt.stageId === stageId)
+ assert(stageAttempt.stageAttemptId == attempt-1)
+ }
+
+ /**
+ * In this test we simulate a job failure where the first stage
completes successfully and
+ * the second stage fails due to a fetch failure. Multiple successive
fetch failures of a stage
+ * trigger an overall stage abort to avoid endless retries.
+ */
+ test("Multiple consecutive stage failures should lead to task being
aborted.") {
+ // Create a new Listener to confirm that the listenerBus sees the
JobEnd message
+ // when we abort the stage. This message will also be consumed by the
EventLoggingListener
+ // so this will propagate up to the user.
+ var ended = false
+ var jobResult : JobResult = null
+ class EndListener extends SparkListener {
+ override def onJobEnd(jobEnd: SparkListenerJobEnd): Unit = {
+ jobResult = jobEnd.jobResult
+ ended = true
+ }
+ }
+
+ sc.listenerBus.addListener(new EndListener())
+
+ val shuffleMapRdd = new MyRDD(sc, 2, Nil)
+ val shuffleDep = new ShuffleDependency(shuffleMapRdd, null)
+ val shuffleId = shuffleDep.shuffleId
+ val reduceRdd = new MyRDD(sc, 2, List(shuffleDep))
+ submit(reduceRdd, Array(0, 1))
+
+ for (attempt <- 1 to Stage.MAX_STAGE_FAILURES) {
--- End diff --
can you change this to `0 until Stage.MAX_STAGE_FAILURES`? That way we
stay 0-indexed throughout, and `checkStageId` doesn't need to subtract one from
the attempt id.
---
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]