Github user jinxing64 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16620#discussion_r100953546
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala ---
    @@ -2161,6 +2161,58 @@ class DAGSchedulerSuite extends SparkFunSuite with 
LocalSparkContext with Timeou
         }
       }
     
    +  test("[SPARK-19263] DAGScheduler should not submit multiple active 
tasksets," +
    +    " even with late completions from earlier stage attempts") {
    +    val rddA = new MyRDD(sc, 2, Nil)
    +    val shuffleDepA = new ShuffleDependency(rddA, new HashPartitioner(2))
    +    val shuffleIdA = shuffleDepA.shuffleId
    +
    +    val rddB = new MyRDD(sc, 2, List(shuffleDepA), tracker = 
mapOutputTracker)
    +    val shuffleDepB = new ShuffleDependency(rddB, new HashPartitioner(2))
    +
    +    val rddC = new MyRDD(sc, 2, List(shuffleDepB), tracker = 
mapOutputTracker)
    +
    +    submit(rddC, Array(0, 1))
    +
    +    assert(taskSets(0).stageId === 0 && taskSets(0).stageAttemptId === 0)
    +    complete(taskSets(0), Seq(
    +      (Success, makeMapStatus("hostA", 2)),
    +      (Success, makeMapStatus("hostA", 2))))
    +
    +    // Fetch failed on hostA.
    +    runEvent(makeCompletionEvent(
    +      taskSets(1).tasks(0),
    +      FetchFailed(makeBlockManagerId("hostA"), shuffleIdA, 0, 0,
    +        "Fetch failure of task: stageId=1, stageAttempt=0, partitionId=0"),
    +      null))
    +
    +    scheduler.resubmitFailedStages()
    +
    +    assert(taskSets(2).stageId === 0 && taskSets(2).stageAttemptId === 1)
    +    complete(taskSets(2), Seq(
    +      (Success, makeMapStatus("hostB", 2)),
    +      (Success, makeMapStatus("hostB", 2))))
    +
    +    // Task succeeds on a failed executor. The success is bogus.
    +    runEvent(makeCompletionEvent(
    +      taskSets(1).tasks(1), Success, makeMapStatus("hostA", 2)))
    +
    +    assert(taskSets(3).stageId === 1 && taskSets(2).stageAttemptId === 1)
    +    runEvent(makeCompletionEvent(
    +      taskSets(3).tasks(0), Success, makeMapStatus("hostB", 2)))
    +
    +    // There should be no new attempt of stage submitted.
    +    assert(taskSets.size === 4)
    --- End diff --
    
    Yes, I think so : )


---
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

Reply via email to