-
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
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8e667f5
test case
scwf 2bfa05b
The failed stage never resubmitted
scwf d02cf93
test case
scwf 7056cd6
fix style
scwf 1f7bd88
test case imporvement
scwf d92adfc
comment fix
scwf 1127ca1
address comments of zsxwing
scwf f91d86f
improve test
scwf 09077cb
comment fix
scwf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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} | ||
|
|
@@ -31,7 +32,7 @@ import org.apache.spark._ | |
| import org.apache.spark.broadcast.BroadcastManager | ||
| import org.apache.spark.rdd.RDD | ||
| import org.apache.spark.scheduler.SchedulingMode.SchedulingMode | ||
| import org.apache.spark.shuffle.MetadataFetchFailedException | ||
| import org.apache.spark.shuffle.{FetchFailedException, MetadataFetchFailedException} | ||
| import org.apache.spark.storage.{BlockId, BlockManagerId, BlockManagerMaster} | ||
| import org.apache.spark.util.{AccumulatorContext, AccumulatorV2, CallSite, LongAccumulator, Utils} | ||
|
|
||
|
|
@@ -2105,6 +2106,61 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with Timeou | |
| assert(scheduler.getShuffleDependencies(rddE) === Set(shuffleDepA, shuffleDepC)) | ||
| } | ||
|
|
||
| test("SPARK-17644: After one stage is aborted for too many failed attempts, subsequent stages" + | ||
| "still behave correctly on fetch failures") { | ||
| // Runs a job that always encounters a fetch failure, so should eventually be aborted | ||
| def runJobWithPersistentFetchFailure: 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() | ||
| } | ||
|
|
||
| // Runs a job that encounters a single fetch failure but succeeds on the second attempt | ||
| def runJobWithTemporaryFetchFailure: 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(10.seconds) { | ||
| val e = intercept[SparkException] { | ||
| runJobWithPersistentFetchFailure | ||
| } | ||
| assert(e.getMessage.contains("org.apache.spark.shuffle.FetchFailedException")) | ||
| } | ||
|
|
||
| // Run a second job that will fail due to a fetch failure. | ||
| // This job will hang without the fix for SPARK-17644. | ||
| failAfter(10.seconds) { | ||
| val e = intercept[SparkException] { | ||
| runJobWithPersistentFetchFailure | ||
| } | ||
| assert(e.getMessage.contains("org.apache.spark.shuffle.FetchFailedException")) | ||
| } | ||
|
|
||
| failAfter(10.seconds) { | ||
| try { | ||
| runJobWithTemporaryFetchFailure | ||
| } catch { | ||
| case e: Throwable => fail("A job with one fetch failure should eventually succeed") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: you don't need to specifically catch an exception and call |
||
| } | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Assert that the supplied TaskSet has exactly the given hosts as its preferred locations. | ||
| * Note that this checks only the host and not the executor ID. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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..."