squito commented on a change in pull request #24497: [SPARK-27630][CORE]
Properly handle task end events from completed stages
URL: https://github.com/apache/spark/pull/24497#discussion_r296302652
##########
File path: core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala
##########
@@ -546,40 +552,41 @@ private[spark] class ExecutorAllocationManager(
override def onStageCompleted(stageCompleted:
SparkListenerStageCompleted): Unit = {
val stageId = stageCompleted.stageInfo.stageId
+ val stageAttemptId = stageCompleted.stageInfo.attemptNumber()
+ val stageAttempt = StageAttempt(stageId, stageAttemptId)
allocationManager.synchronized {
- stageIdToNumTasks -= stageId
- stageIdToNumRunningTask -= stageId
- stageIdToNumSpeculativeTasks -= stageId
- stageIdToTaskIndices -= stageId
- stageIdToSpeculativeTaskIndices -= stageId
- stageIdToExecutorPlacementHints -= stageId
+ stageAttemptToNumTasks -= stageAttempt
Review comment:
I think its worth adding a comment here along the lines of "do NOT remove
stageAttempt from stageAttemptToNumRunningTasks, because the attempt may still
have running tasks, even after another attempt for the stage is submitted."
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]