# Supervision chooses what restarts

Principle `supervision-is-a-recovery-policy`. Restart policy follows dependency shape and bounds repeated recovery.

Also searched as: supervision, restart intensity, restart domain.

OTP restart strategies distinguish independent children from dependent siblings. A persistently broken child also needs a limit on repeated restarts.

> The point of letting an entire subsystem terminate and be restarted is that it brings you back to a state known to function properly.

Source: [Q01](/bibliography#q01); [B1](/bibliography#b1-erlang-and-otp-in-action), [B2](/bibliography#b2-elixir-in-action), [B3](/bibliography#b3-designing-elixir-systems-with-otp).

## Failure it prevents

Healthy siblings restart unnecessarily, or dependent siblings continue with stale state.

## Our Effect 4.0.5 reading

No OTP restart supervisor was found in the checked source. Scope and FiberSet handle lifetime. Use XState for explicit restart modes and a host for runtime restart.

Source: `packages/effect/src/Effect.ts`, `packages/effect/src/Scope.ts`, `packages/effect/src/FiberSet.ts`.

## How to check

Generate child failures and repeated restart attempts. Check affected dependents, escalation, and reconstructed state. This is our proposed verification, not a quoted procedure.

Continue with [Restart must reconstruct known state](/principles/restart-from-known-state), [Circuit breakers have state](/principles/circuit-breakers-have-state).

Connect this to [the existing rat-stack guidance](https://ratstack.sh/lore/lifecycles-are-machines).

Use [the durability skill](/skills/durability) for the full review. Return to [the durability index](/principles/durability).

## Skills
- [Durability starts with a recovery record](/principles/durability)

## Sources
- Logan, Martin; Merritt, Eric; Carlsson, Richard. *Erlang and OTP in Action*. [Link](https://www.manning.com/books/erlang-and-otp-in-action). ([b1-erlang-and-otp-in-action](/bibliography#b1-erlang-and-otp-in-action))
- Jurić, Saša. *Elixir in Action*, Third Edition. Manning, 2024. [Link](https://www.manning.com/books/elixir-in-action-third-edition). ([b2-elixir-in-action](/bibliography#b2-elixir-in-action))
- Gray II, James Edward; Tate, Bruce A. *Designing Elixir Systems with OTP*. Pragmatic Bookshelf, 2019. [Link](https://pragprog.com/titles/jgotp/designing-elixir-systems-with-otp/). ([b3-designing-elixir-systems-with-otp](/bibliography#b3-designing-elixir-systems-with-otp))

## References
- [Effect contributors. Effect 4.0.5. Effect.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/Effect.ts). Pinned source for our Effect mapping, not a claim from the book.
- [Effect contributors. Effect 4.0.5. Scope.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/Scope.ts). Pinned source for our Effect mapping, not a claim from the book.
- [Effect contributors. Effect 4.0.5. FiberSet.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/FiberSet.ts). Pinned source for our Effect mapping, not a claim from the book.
