You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/06 04:14:26 UTC

[GitHub] [spark] mridulm commented on a diff in pull request #38702: [SPARK-41187][CORE] LiveExecutor MemoryLeak in AppStatusListener when ExecutorLost happen

mridulm commented on code in PR #38702:
URL: https://github.com/apache/spark/pull/38702#discussion_r1040439989


##########
core/src/main/scala/org/apache/spark/status/AppStatusListener.scala:
##########
@@ -645,8 +645,11 @@ private[spark] class AppStatusListener(
   }
 
   override def onTaskEnd(event: SparkListenerTaskEnd): Unit = {
-    // TODO: can this really happen?
-    if (event.taskInfo == null) {
+    // TODO: can taskInfo null really happen?
+    // For resubmitted tasks caused by ExecutorLost, the SparkListenerTaskEnd is useless and
+    // will make activeTask in stage to be negative, this will cause stage not be removed in
+    // liveStages, and finally cause executor not removed in deadExecutors
+    if (event.taskInfo == null ||  event.reason == Resubmitted) {

Review Comment:
   It has been a while since I looked at it, but this is what I expect to happen.
   
   - When a task is marked a `Resubmitted`, the stage metrics are reverted from the earlier (successful) task completion. (`metricsDelta`)
   - Failed tasks counter should go up - for both stage and executor.
   - Active tasks MUST not go down - this is the issue we have to fix.
   
   Rest of the method should not have too much of a change imo.
   
   Cab the change not simply be limited to `if (event.reason != Resubmitted) <foo>.activeTasks -= 1` ?



-- 
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-unsubscribe@spark.apache.org

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


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