Github user brad-kaiser commented on a diff in the pull request:
https://github.com/apache/spark/pull/19041#discussion_r155399170
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
---
@@ -601,40 +602,41 @@ class CoarseGrainedSchedulerBackend(scheduler:
TaskSchedulerImpl, val rpcEnv: Rp
*
* @param executorIds identifiers of executors to kill
* @param replace whether to replace the killed executors with new ones,
default false
- * @param force whether to force kill busy executors, default false
+ * @param forceIfBusy whether to force kill busy executors, default false
+ * @param forceIfPending whether to force kill executors that are
pending to die, default false
* @return the ids of the executors acknowledged by the cluster manager
to be removed.
*/
final override def killExecutors(
executorIds: Seq[String],
replace: Boolean,
- force: Boolean): Seq[String] = {
+ forceIfBusy: Boolean,
+ forceIfPending: Boolean): Seq[String] = {
logInfo(s"Requesting to kill executor(s) ${executorIds.mkString(",
")}")
- val response = synchronized {
+ val response: Future[Seq[String]] = synchronized {
val (knownExecutors, unknownExecutors) =
executorIds.partition(executorDataMap.contains)
- unknownExecutors.foreach { id =>
- logWarning(s"Executor to kill $id does not exist!")
- }
+ unknownExecutors.foreach(id => logWarning(s"Executor to kill $id
does not exist!"))
// If an executor is already pending to be removed, do not kill it
again (SPARK-9795)
// If this executor is busy, do not kill it unless we are told to
force kill it (SPARK-9552)
val executorsToKill = knownExecutors
- .filter { id => !executorsPendingToRemove.contains(id) }
- .filter { id => force || !scheduler.isExecutorBusy(id) }
- executorsToKill.foreach { id => executorsPendingToRemove(id) =
!replace }
+ .filter { id => forceIfPending ||
!executorsPendingToRemove.contains(id) }
+ .filter { id => forceIfBusy || !scheduler.isExecutorBusy(id) }
+ executorsToKill.foreach(id => executorsPendingToRemove(id) =
!replace)
--- End diff --
fixed
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]