Restore termination behavior for non-remember entities (#29175)

... and add testcoverage
This commit is contained in:
Johan Andrén 2020-06-04 10:27:20 +02:00 committed by GitHub
parent fb39ac1a9c
commit 45d9d89fbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 156 additions and 4 deletions

View file

@ -847,10 +847,15 @@ private[akka] class Shard(
if (verboseDebug)
log.debug("Stop of [{}] arrived, already is among the pending stops", entityId)
case Active(_) =>
log.debug("Entity [{}] stopped without passivating, will restart after backoff", entityId)
entities.waitingForRestart(entityId)
val msg = RestartTerminatedEntity(entityId)
timers.startSingleTimer(msg, msg, entityRestartBackoff)
if (rememberEntitiesStore.isDefined) {
log.debug("Entity [{}] stopped without passivating, will restart after backoff", entityId)
entities.waitingForRestart(entityId)
val msg = RestartTerminatedEntity(entityId)
timers.startSingleTimer(msg, msg, entityRestartBackoff)
} else {
log.debug("Entity [{}] terminated", entityId)
entities.removeEntity(entityId)
}
case Passivating(_) =>
if (entities.pendingRememberedEntitiesExist()) {