thejdeep commented on a change in pull request #34607:
URL: https://github.com/apache/spark/pull/34607#discussion_r753559069



##########
File path: core/src/main/scala/org/apache/spark/status/AppStatusListener.scala
##########
@@ -747,6 +755,19 @@ private[spark] class AppStatusListener(
         maybeUpdate(esummary, now)
       }
 
+      val speculationStageSummary = stage.speculationStageSummary
+      if (event.taskInfo.speculative) {
+        speculationStageSummary.numActiveTasks -= 1
+        speculationStageSummary.numCompletedTasks += completedDelta
+        speculationStageSummary.numFailedTasks += failedDelta
+        speculationStageSummary.numKilledTasks += killedDelta
+      }
+      if (isLastTask && event.taskInfo.speculative) {
+        update(speculationStageSummary, now)
+      } else if (stage.speculationStageSummary.numTasks > 0) {
+        maybeUpdate(speculationStageSummary, now)
+      }

Review comment:
       I changed `maybeUpdate` to `update` when we encounter a speculative 
task. The problem with the previous approach was that - if we have a 
speculative task, then future task end events would all make unnecessary 
speculation summary writes to DB. What do you think ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to