-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-17644] [CORE] Do not add failedStages when abortStage for fetch failure #15213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
8e667f5
2bfa05b
d02cf93
7056cd6
1f7bd88
d92adfc
1127ca1
f91d86f
09077cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
| package org.apache.spark.scheduler | ||
|
|
||
| import java.util.Properties | ||
| import java.util.concurrent.atomic.AtomicBoolean | ||
|
|
||
| import scala.annotation.meta.param | ||
| import scala.collection.mutable.{ArrayBuffer, HashMap, HashSet, Map} | ||
|
|
@@ -2106,18 +2107,37 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with Timeou | |
| assert(scheduler.getShuffleDependencies(rddE) === Set(shuffleDepA, shuffleDepC)) | ||
| } | ||
|
|
||
| test("The failed stage never resubmitted due to abort stage in another thread") { | ||
| test("After one stage is aborted for too many failed attempts, subsequent stages" + | ||
| "still behave correctly on fetch failures") { | ||
| def fetchFailJob: Unit = { | ||
|
||
| val rdd1 = sc.makeRDD(Array(1, 2, 3, 4), 2).map(x => (x, 1)).groupByKey() | ||
| val shuffleHandle = | ||
| rdd1.dependencies.head.asInstanceOf[ShuffleDependency[_, _, _]].shuffleHandle | ||
| rdd1.map { | ||
| case (x, _) if (x == 1) => | ||
| throw new FetchFailedException( | ||
| BlockManagerId("1", "1", 1), shuffleHandle.shuffleId, 0, 0, "test") | ||
| case (x, _) => x | ||
| }.count() | ||
| } | ||
|
|
||
| def successJob: Unit = { | ||
|
||
| object FailThisAttempt { | ||
| val _fail = new AtomicBoolean(true) | ||
| } | ||
| val rdd1 = sc.makeRDD(Array(1, 2, 3, 4), 2).map(x => (x, 1)).groupByKey() | ||
| val shuffleHandle = | ||
| rdd1.dependencies.head.asInstanceOf[ShuffleDependency[_, _, _]].shuffleHandle | ||
| rdd1.map { | ||
| case (x, _) if (x == 1) && FailThisAttempt._fail.getAndSet(false) => | ||
| throw new FetchFailedException( | ||
| BlockManagerId("1", "1", 1), shuffleHandle.shuffleId, 0, 0, "test") | ||
| } | ||
| } | ||
|
|
||
| failAfter(60.seconds) { | ||
| val e = intercept[SparkException] { | ||
| val rdd1 = sc.makeRDD(Array(1, 2, 3, 4), 2).map(x => (x, 1)).groupByKey() | ||
| val shuffleHandle = | ||
| rdd1.dependencies.head.asInstanceOf[ShuffleDependency[_, _, _]].shuffleHandle | ||
| rdd1.map { | ||
| case (x, _) if (x == 1) => | ||
| throw new FetchFailedException( | ||
| BlockManagerId("1", "1", 1), shuffleHandle.shuffleId, 0, 0, "test") | ||
| case (x, _) => x | ||
| }.count() | ||
| fetchFailJob | ||
| } | ||
| assert(e.getMessage.contains("org.apache.spark.shuffle.FetchFailedException")) | ||
| } | ||
|
|
@@ -2126,18 +2146,18 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with Timeou | |
| // the fix for SPARK-17644 | ||
|
||
| failAfter(60.seconds) { | ||
|
||
| val e = intercept[SparkException] { | ||
| val rdd2 = sc.makeRDD(Array(1, 2, 3, 4), 2).map(x => (x, 1)).groupByKey() | ||
| val shuffleHandle = | ||
| rdd2.dependencies.head.asInstanceOf[ShuffleDependency[_, _, _]].shuffleHandle | ||
| rdd2.map { | ||
| case (x, _) if (x == 1) => | ||
| throw new FetchFailedException( | ||
| BlockManagerId("1", "1", 1), shuffleHandle.shuffleId, 0, 0, "test") | ||
| case (x, _) => x | ||
| }.count() | ||
| fetchFailJob | ||
| } | ||
| assert(e.getMessage.contains("org.apache.spark.shuffle.FetchFailedException")) | ||
| } | ||
|
|
||
| failAfter(60.seconds) { | ||
| try { | ||
| successJob | ||
| } catch { | ||
| case e: Throwable => fail("this job should success") | ||
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the JIRA number here? That helps with tracking tests in the future. So something like "[SPARK-17644] After one stage is aborted..."