toujours33 commented on code in PR #38711: URL: https://github.com/apache/spark/pull/38711#discussion_r1028811606
########## core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala: ########## @@ -749,8 +749,10 @@ private[spark] class ExecutorAllocationManager( stageAttemptToNumRunningTask.getOrElse(stageAttempt, 0) + 1 // If this is the last pending task, mark the scheduler queue as empty if (taskStart.taskInfo.speculative) { - stageAttemptToSpeculativeTaskIndices.getOrElseUpdate(stageAttempt, - new mutable.HashSet[Int]) += taskIndex + stageAttemptToSpeculativeTaskIndices + .getOrElseUpdate(stageAttempt, new mutable.HashSet[Int]).add(taskIndex) + stageAttemptToUnsubmittedSpeculativeTasks Review Comment: 1. How about `stageAttemptToUnsubmittedSpeculativeTasks .get(stageAttempt).foreach(_.remove(taskIndex))`. In this way, nothing will changed even if `stageAttemptToUnsubmittedSpecificativeTasks` not initialized. 2. For `stageAttemptToUnsubmittedSpeculativeTasks` is thread-safe, `stageAttemptToUnsubmittedSpeculativeTasks.contains(stageAttempt)` would be correct anyway -- 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