I sporadically use Akka.NET in my projects, so I know the technology, can do stuff with it, but do not consider myself an expert.
Although I use .NET, the question can certainly be answered by someone familiar with Akka on the JVM.
Recently, I came across a DeathPactException
while looking at an application's log file. The cause was an actor (actor A1) that watched another actor (A2), which it had started itself. A1, however, did not handle the Terminated
message sent by A2. Which was caused by A2 actually stopping itself after performing its task. Thanks to a reasonably-defined supervisor hierarchy etc. the system itself worked just fine: A1 was simply restarted by its supervisor immediately.
Is there actually any scenario where an actor would .Watch()
another actor and then ignore the Terminated
message? Or is the infamous DeathPactException
basically always a bug in application code, similar to a NullReferenceException
/NullPointerException
?