Skip to content

Commit 7965580

Browse files
committed
fix Statement order
1 parent 0e29eac commit 7965580

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, actorSystem: A
141141
// Launch tasks returned by a set of resource offers
142142
def launchTasks(tasks: Seq[Seq[TaskDescription]]) {
143143
for (task <- tasks.flatten) {
144-
freeCores(task.executorId) -= scheduler.CPUS_PER_TASK
145144
val ser = SparkEnv.get.closureSerializer.newInstance()
146145
val serializedTask = ser.serialize(task)
147146
if (serializedTask.limit >= akkaFrameSize - 1024) {
@@ -152,6 +151,7 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, actorSystem: A
152151
logError(msg, exception)
153152
throw exception
154153
}
154+
freeCores(task.executorId) -= scheduler.CPUS_PER_TASK
155155
executorActor(task.executorId) ! LaunchTask(new SerializableBuffer(serializedTask))
156156
}
157157
}

0 commit comments

Comments
 (0)