Skip to content

Commit e8bec83

Browse files
mbautinmarkhamstra
authored andcommitted
Only reduce the number of cores once when removing an executor
1 parent 550b0cf commit e8bec83

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/main/scala/spark/deploy/master/ApplicationInfo.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ private[spark] class ApplicationInfo(
5252
}
5353

5454
def removeExecutor(exec: ExecutorInfo) {
55-
executors -= exec.id
56-
coresGranted -= exec.cores
55+
if (executors.contains(exec.id)) {
56+
executors -= exec.id
57+
coresGranted -= exec.cores
58+
}
5759
}
5860

5961
def coresLeft: Int = desc.maxCores - coresGranted

0 commit comments

Comments
 (0)