turboFei commented on code in PR #3144: URL: https://github.com/apache/celeborn/pull/3144#discussion_r1988412053
########## client-spark/spark-3/src/main/scala/org/apache/spark/shuffle/celeborn/ShuffleFetchFailureReportTaskCleanListener.scala: ########## @@ -17,12 +17,26 @@ package org.apache.spark.shuffle.celeborn +import scala.collection.JavaConverters._ + import org.apache.spark.scheduler.{SparkListener, SparkListenerStageCompleted} class ShuffleFetchFailureReportTaskCleanListener extends SparkListener { override def onStageCompleted(stageCompleted: SparkListenerStageCompleted): Unit = { - SparkUtils.removeStageReportedShuffleFetchFailureTaskIds( - stageCompleted.stageInfo.stageId, - stageCompleted.stageInfo.attemptNumber()) + val stageId = stageCompleted.stageInfo.stageId + val stageAttemptId = stageCompleted.stageInfo.attemptNumber() + val shuffleFetchFailureTaskIds = + SparkUtils.removeStageReportedShuffleFetchFailureTaskIds(stageId, stageAttemptId) + if (shuffleFetchFailureTaskIds != null) { + shuffleFetchFailureTaskIds.asScala.headOption.foreach { case taskId => + val taskSetManager = SparkUtils.getTaskSetManager(taskId) + if (taskSetManager != null && taskSetManager.runningTasks > 0) { Review Comment: even we do not know whether the shuffleFetchFailureTaskIds related task did cause the FetchFailedException eventually(another task running or finished, see https://github.com/apache/celeborn/pull/2921). But it should be safe after we check the `taskSetManager.runningTasks > 0`. ########## client-spark/spark-3/src/main/scala/org/apache/spark/shuffle/celeborn/ShuffleFetchFailureReportTaskCleanListener.scala: ########## @@ -17,12 +17,26 @@ package org.apache.spark.shuffle.celeborn +import scala.collection.JavaConverters._ + import org.apache.spark.scheduler.{SparkListener, SparkListenerStageCompleted} class ShuffleFetchFailureReportTaskCleanListener extends SparkListener { override def onStageCompleted(stageCompleted: SparkListenerStageCompleted): Unit = { - SparkUtils.removeStageReportedShuffleFetchFailureTaskIds( - stageCompleted.stageInfo.stageId, - stageCompleted.stageInfo.attemptNumber()) + val stageId = stageCompleted.stageInfo.stageId + val stageAttemptId = stageCompleted.stageInfo.attemptNumber() + val shuffleFetchFailureTaskIds = + SparkUtils.removeStageReportedShuffleFetchFailureTaskIds(stageId, stageAttemptId) + if (shuffleFetchFailureTaskIds != null) { + shuffleFetchFailureTaskIds.asScala.headOption.foreach { case taskId => + val taskSetManager = SparkUtils.getTaskSetManager(taskId) + if (taskSetManager != null && taskSetManager.runningTasks > 0) { Review Comment: even we do not know whether the shuffleFetchFailureTaskIds related task did trigger the FetchFailedException eventually(another task running or finished, see https://github.com/apache/celeborn/pull/2921). But it should be safe after we check the `taskSetManager.runningTasks > 0`. -- 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: issues-unsubscr...@celeborn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org