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
