mridulm commented on a change in pull request #30795:
URL: https://github.com/apache/spark/pull/30795#discussion_r545539133
##########
File path:
core/src/main/scala/org/apache/spark/scheduler/dynalloc/ExecutorMonitor.scala
##########
@@ -180,6 +181,15 @@ private[spark] class ExecutorMonitor(
}
}
+ def excludedExecutorCount: Int = {
+ if (conf.get(EXCLUDE_ON_FAILURE_ENABLED).getOrElse(false) &&
+ !conf.get(EXCLUDE_ON_FAILURE_KILL_ENABLED)) {
Review comment:
Pull these boolean's out as instance variables instead of looking them
up each time ?
##########
File path:
core/src/main/scala/org/apache/spark/scheduler/dynalloc/ExecutorMonitor.scala
##########
@@ -348,6 +360,11 @@ private[spark] class ExecutorMonitor(
execResourceProfileCount.remove(rpId, 0)
}
+ private def increaseExecResourceProfileCount(rpId: Int): Unit = {
Review comment:
nit: `increaseExecResourceProfileCount` ->
`incrementExecResourceProfileCount`
##########
File path:
core/src/main/scala/org/apache/spark/scheduler/dynalloc/ExecutorMonitor.scala
##########
@@ -516,6 +563,8 @@ private[spark] class ExecutorMonitor(
var pendingRemoval: Boolean = false
var decommissioning: Boolean = false
var hasActiveShuffle: Boolean = false
+ // whether the executor is temporarily excluded by the `HealthTracker`
+ var isExcluded: Boolean = false
Review comment:
nit: isExcluded -> excluded
##########
File path:
core/src/main/scala/org/apache/spark/scheduler/dynalloc/ExecutorMonitor.scala
##########
@@ -418,6 +437,36 @@ private[spark] class ExecutorMonitor(
}
}
+ override def onExecutorExcluded(executorExcluded:
SparkListenerExecutorExcluded): Unit = {
+ if (!conf.get(EXCLUDE_ON_FAILURE_KILL_ENABLED)) {
+ val exec = executors.get(executorExcluded.executorId)
+ exec.isExcluded = true
Review comment:
Here and elsewhere, defend against `exec` being `null` ?
Either with explicit `if (null != exec)` check or via
`Option(executors.get(...)).foreach(exec => )`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]