Github user ilganeli commented on a diff in the pull request:
https://github.com/apache/spark/pull/5636#discussion_r38566621
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala ---
@@ -473,6 +473,280 @@ 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)
+ }
+
+ def makeCompletions(stageAttempt: TaskSet, reduceParts: Int):
Seq[(Success.type, MapStatus)] = {
+ stageAttempt.tasks.zipWithIndex.map { case (task, idx) =>
+ (Success, makeMapStatus("host" + ('A' + idx).toChar, reduceParts))
+ }.toSeq
+ }
+
+ def setupStageAbortTest(sc: SparkContext) {
+ sc.listenerBus.addListener(new EndListener())
+ ended = false
+ jobResult = null
+ }
+
+ // 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
+ }
+ }
+
+ // Helper functions to extract commonly used code in Fetch Failure test
cases
+ /**
+ * Common code to get the next stage attempt, confirm it's the one we
expect, and complete it
+ * succesfullly.
+ *
+ * @param stageId - The current stageId
+ * @param attemptIdx - The current attempt count
+ * @param numShufflePartitions - The number of partitions in the next
stage
+ */
+ def completeNextShuffleMapSuccesfully(stageId: Int, attemptIdx: Int,
+ numShufflePartitions: Int): Unit = {
+ val stageAttempt = taskSets.last
+ checkStageId(stageId, attemptIdx, stageAttempt)
+ complete(stageAttempt, makeCompletions(stageAttempt,
numShufflePartitions))
+ }
+
+ /**
+ * Common code to get the next stage attempt, confirm it's the one we
expect, and complete it
+ * with all FetchFailure.
--- End diff --
Imran â I donât have cycles to do a significant refactor at the moment.
I would suggest we merge and follow up later.
From: Imran Rashid
<[email protected]<mailto:[email protected]>>
Reply-To: apache/spark
<[email protected]<mailto:[email protected]>>
Date: Wednesday, September 2, 2015 at 11:24 AM
To: apache/spark <[email protected]<mailto:[email protected]>>
Cc: "Ganelin, Ilya"
<[email protected]<mailto:[email protected]>>
Subject: Re: [spark] [SPARK-5945] Spark should not retry a stage infinitely
on a FetchFailedException (#5636)
In
core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala<https://github.com/apache/spark/pull/5636#discussion_r38566341>:
> + * succesfullly.
> + *
> + * @param stageId - The current stageId
> + * @param attemptIdx - The current attempt count
> + * @param numShufflePartitions - The number of partitions in the next
stage
> + */
> + def completeNextShuffleMapSuccesfully(stageId: Int, attemptIdx: Int,
> + numShufflePartitions: Int): Unit = {
> + val stageAttempt = taskSets.last
> + checkStageId(stageId, attemptIdx, stageAttempt)
> + complete(stageAttempt, makeCompletions(stageAttempt,
numShufflePartitions))
> + }
> +
> + /**
> + * Common code to get the next stage attempt, confirm it's the one we
expect, and complete it
> + * with all FetchFailure.
yeah, agree that as is, that test isn't really adding anything over the
other tests as you've noted. I certainly don't think I'd say "too hard to fix"
-- I suppose its just my antsy-ness to get this in, but objectively, it
probably makes sense to fix. all you are really asking is to change
completeNextStageWithFetchFailure to oneFetchFailureInNextStage and change
"Multiple tasks w/ fetch failures..." to just directly do what this method is
doing now, pretty minor change.
How about this: wait a day for @ilganeli<https://github.com/ilganeli> to
update, and if he doesn't get to it we merge as-is and I do a simple follow-up
pr?
â
Reply to this email directly or view it on
GitHub<https://github.com/apache/spark/pull/5636/files#r38566341>.
________________________________________________________
The information contained in this e-mail is confidential and/or proprietary
to Capital One and/or its affiliates and may only be used solely in performance
of work or services for Capital One. The information transmitted herewith is
intended only for use by the individual or entity to which it is addressed. If
the reader of this message is not the intended recipient, you are hereby
notified that any review, retransmission, dissemination, distribution, copying
or other use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error, please
contact the sender and delete the material from your computer.
---
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]