Here is the situation, One my actors (A) is supervised by a Backoff supervisor (B).
The sequence of events that interest me is the following:
On step 4, what happens to those messages?
Are they lost? Sent to dead-letters? stashed inside B somewhere, and sent to A when it restarts / resumes?
Now let's add another layer: A is not a standard Actor but an Actor with Stash.
What happens to the stash of messages between the failure of A and its restart/resume? Is it discarded? Is it unstashed? Is it kept inside the stash?
After a few experiments, I think I can answer both of my questions above:
What happens to messages sent to an actor supervised by a Backoff supervisor between the moment the actor fails and the moment it is restarted?
They are sent to deadLetters()
What happens to the stash of messages between the failure of an actor and its restart?
Nothing happens to the stash until the restart is actually attempted. When the restarting process starts, the preRestart()
step of the stash calls unstashAll()
to return all messages to the mailbox. Therefore messages are not lost, and not kept in the stash, but just unstashed and returned to the mailbox.