jonnify·bcs /bcs/elixir-core/otp-application/the-supervision-tree

B2.1.2 · dive 2 of 6 · module B2.1

The supervision tree.

The system runs under a one_for_one supervisor: one store per {name, namespace}, each restarted in isolation. Let-it-crash, contained.

A one_for_one tree; one child crashing and restarting; siblings untouched. Select a part.
Supervisorone_for_one store A — crashedfresh A store Buntouchedstore Cuntouched
readout · Select a part. EchoData.Bcs.Supervisor is one_for_one over named stores; a crashed child restarts clean in isolation; siblings are untouched.
§1

The idea

echo_data · bcs/supervisor.ex

A system does not run loose; it runs under a supervisor. EchoData.Bcs.Supervisor is one_for_one over named property stores: it starts one PropertyStore child per {name, namespace} pair, each a GenServer with its own private table. The supervisor is the system’s parent, and the tree is the shape a deployment starts.

one_for_one is a containment strategy. If one store crashes — a bad message, an unexpected value — the supervisor restarts that one child and leaves its siblings untouched; a fault in the orders store never disturbs the players store. This is let-it-crash as architecture: a process that reaches a state it cannot handle dies, and a clean one takes its place, rather than corruption spreading through shared memory.

Codemojex inherits the tree. Each room is a supervised child, so a crash in one room never takes down another; the command workers that drain EchoMQ.Lanes are supervised the same way, restarted on failure without losing the lane. The supervision tree is how a system of many rooms stays up while any one room is allowed to fail.

§4

The doors

the sibling courses
§2

References

sources · related

Sources

Related