liveBook · Manning

Let it crash

As explained in Akka in Action, Second Edition

The let-it-crash principle is a fault-tolerance approach in which failed components are allowed to terminate so that supervision can restart or replace them.

Let it crash is a fault-tolerance technique for actor systems: allow a failed component to terminate, then let supervision decide whether to stop, restart, resume, or replace it. The principle does not ignore failures; it separates ordinary message processing from recovery logic and requires planned recovery behavior. section 5.0 section 5.6

The approach gains its resilience from several actor-system properties:

  • Fault isolation: a supervisor can terminate a failed actor and remove it from the ActorSystem. section 5.1.2
  • Structural replacement: actor references and hierarchy allow an actor instance to be replaced without affecting other actors. section 5.1.2
  • Redundancy: a replacement actor can connect to another database or messages can be routed across multiple actors. section 5.1.2
  • Lifecycle control: actors can be started, stopped, restarted, suspended, or recreated from their behavior. section 5.1.2
  • Message safety: after an exception, Akka does not normally leave the failed message in the mailbox, avoiding repeated failure from a poisoned mailbox. section 5.1.2

A corrupted LogProcessor input

Suppose a LogProcessor encounters a corrupted file or an unparseable line. Letting the actor fail prevents it from repeatedly reprocessing the same message and blocking later work. Its supervisor can then choose an appropriate recovery action, such as stopping or restarting the actor. section 5.1.2

How Akka in Action, Second Edition covers it

How deep it goes
Explains failure isolation, mailbox handling, lifecycle actions, and replacement, while deferring detailed restart implementation.
Examples
Uses a LogProcessor handling corrupted input and a replacement actor recovering a broken database connection.
What it assumes
Assumes actor-based message processing and actor hierarchies, while framing supervision as a separate recovery flow.
What you can do after
Apply Akka supervision by planning recovery actions for failed actors instead of embedding fault recovery in normal message processing.
How it connects
Connects actor supervision with monitoring, actor lifecycle, supervisor strategies, message processing, and clustering.

Related concepts

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.