You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by andrewor14 <gi...@git.apache.org> on 2015/04/14 20:36:22 UTC

[GitHub] spark pull request: [SPARK-5259][CORE]Make sure mapStage.pendingta...

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

    https://github.com/apache/spark/pull/4055#discussion_r28356278
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala ---
    @@ -543,6 +543,53 @@ class DAGSchedulerSuite extends FunSuiteLike  with BeforeAndAfter with LocalSpar
         assertDataStructuresEmpty
       }
     
    +  test("Make sure mapStage.pendingtasks is set() " +
    +    "while MapStage.isAvailable is true while stage was retry ") {
    +    val firstRDD = new MyRDD(sc, 6, Nil)
    +    val firstShuffleDep = new ShuffleDependency(firstRDD, null)
    +    val firstShuyffleId = firstShuffleDep.shuffleId
    +    val shuffleMapRdd = new MyRDD(sc, 6, List(firstShuffleDep))
    +    val shuffleDep = new ShuffleDependency(shuffleMapRdd, null)
    +    val reduceRdd = new MyRDD(sc, 2, List(shuffleDep))
    +    submit(reduceRdd, Array(0, 1))
    +    complete(taskSets(0), Seq(
    +      (Success, makeMapStatus("hostB", 1)),
    +      (Success, makeMapStatus("hostB", 2)),
    +      (Success, makeMapStatus("hostC", 3)),
    +      (Success, makeMapStatus("hostB", 4)),
    +      (Success, makeMapStatus("hostB", 5)),
    +      (Success, makeMapStatus("hostC", 6))
    +    ))
    +    complete(taskSets(1), Seq(
    +      (Success, makeMapStatus("hostA", 1)),
    +      (Success, makeMapStatus("hostB", 2)),
    +      (Success, makeMapStatus("hostA", 1)),
    +      (Success, makeMapStatus("hostB", 2)),
    +      (Success, makeMapStatus("hostA", 1))
    +    ))
    +    runEvent(ExecutorLost("exec-hostA"))
    +    runEvent(CompletionEvent(taskSets(1).tasks(0), Resubmitted,
    +      null, null, createFakeTaskInfo(), null))
    +    runEvent(CompletionEvent(taskSets(1).tasks(2), Resubmitted,
    +      null, null, createFakeTaskInfo(), null))
    +    runEvent(CompletionEvent(taskSets(1).tasks(0),
    +      FetchFailed(null, firstShuyffleId, -1, 0, "Fetch Mata data failed"),
    +      null, null, createFakeTaskInfo(), null))
    +    scheduler.resubmitFailedStages()
    +    runEvent(CompletionEvent(taskSets(1).tasks(0), Success,
    +      makeMapStatus("hostC", 1), null, createFakeTaskInfo(), null))
    +    runEvent(CompletionEvent(taskSets(1).tasks(2), Success,
    +      makeMapStatus("hostC", 1), null, createFakeTaskInfo(), null))
    +    runEvent(CompletionEvent(taskSets(1).tasks(4), Success,
    +      makeMapStatus("hostC", 1), null, createFakeTaskInfo(), null))
    +    runEvent(CompletionEvent(taskSets(1).tasks(5), Success,
    +      makeMapStatus("hostB", 2), null, createFakeTaskInfo(), null))
    +    val stage = scheduler.stageIdToStage(taskSets(1).stageId)
    +    assert(stage.attemptId == 2)
    +    assert(stage.isAvailable)
    +    assert(stage.pendingTasks.size == 0)
    --- End diff --
    
    these should be `===` in tests


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org