Exception from receiveRecover should stop the PersistentActor #24192
This commit is contained in:
parent
9a13704969
commit
6fa74789ce
2 changed files with 19 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue