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

    https://github.com/apache/spark/pull/16867#discussion_r103391138
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -911,14 +916,14 @@ private[spark] class TaskSetManager(
         logDebug("Checking for speculative tasks: minFinished = " + 
minFinishedForSpeculation)
         if (tasksSuccessful >= minFinishedForSpeculation && tasksSuccessful > 
0) {
           val time = clock.getTimeMillis()
    -      val durations = 
taskInfos.values.filter(_.successful).map(_.duration).toArray
    -      Arrays.sort(durations)
    +      val durations = successfulTasksSet.toArray.map(taskInfos(_).duration)
           val medianDuration = durations(min((0.5 * 
tasksSuccessful).round.toInt, durations.length - 1))
           val threshold = max(SPECULATION_MULTIPLIER * medianDuration, 
minTimeToSpeculation)
           // TODO: Threshold should also look at standard deviation of task 
durations and have a lower
           // bound based on that.
           logDebug("Task length threshold for speculation: " + threshold)
    -      for ((tid, info) <- taskInfos) {
    +      for (tid <- runningTasksSet) {
    +        val info = taskInfos(tid)
    --- End diff --
    
    @kayousterhout 
    Thanks a lot for your comments :)
    I will keep this simple change in this pr. For time complexity improvement, 
I will make another pr and try add some measurements.


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