My user supervisor actor creates child actors C1 and C2 ; C1 is supervisor to C11 ; C2 is supervisor to C21.
-
now, if C1 throws an error, supervisor would restart C1. From below code and akka doc, it appears that C1 will stop C11. Due to C1 restart, its messages are not lost. However, will C11 messages be lost as its stopped?
-
C2 will be restarted due to sibling error and hence not lose its messages. However, it appears C21 will be stopped and lose its messages.
Is my above understanding correct? My above statements are based on the below code in Actor trait:
def preRestart(reason: Throwable, message: Option[Any]): Unit = {
context.children foreach { child ⇒
context.unwatch(child)
context.stop(child)
}
postStop()
}