liveBook · Manning

Poisoned mailbox

As explained in Akka in Action, Second Edition

A poisoned mailbox is an actor mailbox in which a repeatedly failing message prevents subsequent messages from being processed.

A poisoned mailbox is an actor mailbox where one repeatedly failing message prevents later messages from being processed. A corrupted file or unparseable line can create this condition when reprocessing repeats the same failure. section 5.1.2

Avoid the failure pattern with these operational choices:

  • Do not normally reprocess a failed message, because it may have caused the exception. section 5.1.2
  • Let the supervisor choose whether to resume, stop, or restart the actor after an exception. section 5.1.2
  • Remove the failed message from the mailbox unless you are certain it did not cause the error. section 5.1.2

LogProcessor

A LogProcessor encounters a corrupted file or unparseable line. Retrying that message indefinitely can block every subsequent message, whereas discarding it allows processing to continue under the supervisor’s recovery policy. section 5.1.2

Figure 5.6 Supervisor wrapping an actor’s behavior and deciding on a recovery action after an exception
CH05_F06_Abraham2

Trace how a supervisor wraps actor behavior and selects a recovery action after an exception. section 5.1.2

How Akka in Action, Second Edition covers it

How deep it goes
Defines the failure mode and handling rule, but defers detailed restart implementation.
Examples
Uses a LogProcessor handling a corrupted file or unparseable line.
What it assumes
Assumes actors, mailboxes, exceptions, and supervisors, while illustrating their failure interaction through a concrete processor.
What you can do after
Diagnose mailbox blockage and configure recovery without blindly reprocessing the failing message.
How it connects
Connects actor mailboxes with supervisors, exceptions, restarts, and fault isolation.

This explainer was generated by Manning's knowledge graph from the text of Akka in Action, Second Edition. The section links point to the parts of the book it draws on.