Exception from receiveRecover should stop the PersistentActor #24192

This commit is contained in:
ryota-sakamoto 2018-02-22 01:20:52 +09:00 committed by Johan Andrén
parent 9a13704969
commit 6fa74789ce
2 changed files with 19 additions and 2 deletions

View file

@ -663,6 +663,11 @@ object PersistentActorSpec {
case Cmd(d) persist(Evt(d))(updateState)
}
}
class ExceptionActor(name: String) extends ExamplePersistentActor(name) {
override def receiveCommand = commonBehavior
override def receiveRecover = throw new TestException("boom")
}
}
abstract class PersistentActorSpec(config: Config) extends PersistenceSpec(config) with ImplicitSender {
@ -1176,6 +1181,12 @@ abstract class PersistentActorSpec(config: Config) extends PersistenceSpec(confi
persistentActor ! "boom"
expectTerminated(persistentActor)
}
"stop actor when direct exception from receiveRecover" in {
val persistentActor = namedPersistentActor[ExceptionActor]
watch(persistentActor)
expectTerminated(persistentActor)
}
}
}