Skip to content
Snippets Groups Projects
Commit 51898b51 authored by Ryan Williams's avatar Ryan Williams Committed by Andrew Or
Browse files

[SPARK-8088] don't attempt to lower number of executors by 0

Author: Ryan Williams <ryan.blake.williams@gmail.com>

Closes #6624 from ryan-williams/execs and squashes the following commits:

b6f71d4 [Ryan Williams] don't attempt to lower number of executors by 0
parent 566cb594
No related branches found
No related tags found
No related merge requests found
......@@ -266,10 +266,14 @@ private[spark] class ExecutorAllocationManager(
// executors and inform the cluster manager to cancel the extra pending requests
val oldNumExecutorsTarget = numExecutorsTarget
numExecutorsTarget = math.max(maxNeeded, minNumExecutors)
client.requestTotalExecutors(numExecutorsTarget)
numExecutorsToAdd = 1
logInfo(s"Lowering target number of executors to $numExecutorsTarget because " +
s"not all requests are actually needed (previously $oldNumExecutorsTarget)")
// If the new target has not changed, avoid sending a message to the cluster manager
if (numExecutorsTarget < oldNumExecutorsTarget) {
client.requestTotalExecutors(numExecutorsTarget)
logInfo(s"Lowering target number of executors to $numExecutorsTarget (previously " +
s"$oldNumExecutorsTarget) because not all requested executors are actually needed")
}
numExecutorsTarget - oldNumExecutorsTarget
} else if (addTime != NOT_SET && now >= addTime) {
val delta = addExecutors(maxNeeded)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment