tgravescs commented on a change in pull request #27773: [SPARK-29154][CORE]
Update Spark scheduler for stage level scheduling
URL: https://github.com/apache/spark/pull/27773#discussion_r389933552
##########
File path:
core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
##########
@@ -140,12 +141,12 @@ class CoarseGrainedSchedulerBackend(scheduler:
TaskSchedulerImpl, val rpcEnv: Rp
}
override def receive: PartialFunction[Any, Unit] = {
- case StatusUpdate(executorId, taskId, state, data, resources) =>
+ case StatusUpdate(executorId, taskId, state, data, taskCpus, resources)
=>
scheduler.statusUpdate(taskId, state, data.value)
if (TaskState.isFinished(state)) {
executorDataMap.get(executorId) match {
case Some(executorInfo) =>
- executorInfo.freeCores += scheduler.CPUS_PER_TASK
+ executorInfo.freeCores += taskCpus
Review comment:
I put it there so that I don't have to worry about race conditions between
when we get status updates from executors and when the scheduler removes the
tasksets. for instance currently we could remove it from the
taskidToTaskSetManager if the executor failed. In the case the taskid to task
set manager is missing we wouldn't know how many cores to properly add back. So
to keep away from that race this seems cleaner and also possibly gives us a way
to expose to the user in the future if we wanted.
----------------------------------------------------------------
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]