Skip to content

Commit

Permalink
Check the instance has one task before calling checkEnoughInstancesRu…
Browse files Browse the repository at this point in the history
…nning

Signed-off-by: Julien DOCHE <[email protected]>
  • Loading branch information
Julien DOCHE committed Sep 29, 2020
1 parent 5649dbb commit c344ead
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ private[health] class HealthCheckActor(
if (instance.isUnreachable) {
logger.info(s"Instance $instanceId on host ${instance.hostname} is temporarily unreachable. Performing no kill.")
} else {
require(instance.tasksMap.size == 1, "Unexpected pod instance in HealthCheckActor")
if (antiSnowballEnabled && !(checkEnoughInstancesRunning(instance))) {
logger.info(s"[anti-snowball] app ${app.id} version ${app.version} Won't kill $instanceId because too few instances are running")
return
}
logger.info(s"Send kill request for $instanceId on host ${instance.hostname.getOrElse("unknown")} to driver")
require(instance.tasksMap.size == 1, "Unexpected pod instance in HealthCheckActor")
val taskId = instance.appTask.taskId
eventBus.publish(
UnhealthyInstanceKillEvent(
Expand Down

0 comments on commit c344ead

Please sign in to comment.