Akka Typed Actor supervision configuration missing explicit restart strategy
0 reputation · 12 Mar 2020, 11:45 UTC
The goal is to configure Typed Actor child supervision so that frequent failures do not cause an unbounded increase in actor instances, which could lead to a memory leak. In Akka Typed, a child created with Behaviors.setup inherits the parent’s supervision strategy unless explicitly wrapped with Behaviors.supervise and an onFailure directive. When the parent’s default strategy is stop, each failure stops the child but the stopped instance may linger in the mailbox queue until garbage collected, allowing the number of stopped actors to grow under high failure rates.
Is it acceptable to rely on the parent’s default supervision strategy for child actors that may experience frequent transient faults? What are the implications of explicitly applying SupervisorStrategy.restart versus leaving the strategy to the parent? How can we verify that the chosen supervision strategy bounds the live actor count under a sustained failure load?