Skip to content

Commit 9d2c9fa

Browse files
committed
Remove adjustment of executorLimitOption in doKillExecutors.
1 parent 8b00f52 commit 9d2c9fa

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,9 @@ private[spark] class CoarseMesosSchedulerBackend(
361361
logWarning("Unable to find executor Id '" + executorId + "' in Mesos scheduler")
362362
}
363363
}
364-
365-
// We cannot simply decrement from the existing executor limit as we may not able to
366-
// launch as much executors as the limit. But we assume if we are notified to kill
367-
// executors, that means the scheduler wants to set the limit that is less than
368-
// the amount of the executors that has been launched. Therefore, we take the existing
369-
// amount of executors launched and deduct the executors killed as the new limit.
370-
executorLimitOption = Some(Math.max(0, taskIdToSlaveId.size - pendingRemovedSlaveIds.size))
364+
// no need to adjust `executorLimitOption` since the AllocationManager already communicated
365+
// the desired limit through a call to `doRequestTotalExecutors`.
366+
// See [[o.a.s.scheduler.cluster.CoarseGrainedSchedulerBackend.killExecutors]]
371367
true
372368
}
373369
}

core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackendSuite.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ class CoarseMesosSchedulerBackendSuite extends SparkFunSuite
105105
// Calling doKillExecutors should invoke driver.killTask.
106106
assert(backend.doKillExecutors(Seq("s1/0")))
107107
verify(driver, times(1)).killTask(taskID0)
108-
assert(backend.executorLimit === 0)
109108

110109
val mesosOffers2 = new java.util.ArrayList[Offer]
111110
mesosOffers2.add(createOffer("o2", "s2", minMem, minCpu))

0 commit comments

Comments
 (0)