Skip to content

Commit 6586e19

Browse files
davidsulcJosé Valim
authored andcommitted
Clarify behavior of strategies regarding the restart option (#7589)
Signed-off-by: José Valim <[email protected]>
1 parent 8291c2f commit 6586e19

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/elixir/lib/supervisor.ex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ defmodule Supervisor do
212212
* `:permanent` - the child process is always restarted.
213213
214214
* `:temporary` - the child process is never restarted, regardless
215-
of the supervision strategy.
215+
of the supervision strategy: any termination (even abnormal) is
216+
considered successful.
216217
217218
* `:transient` - the child process is restarted only if it
218219
terminates abnormally, i.e., with an exit reason other than
@@ -444,6 +445,9 @@ defmodule Supervisor do
444445
the child processes, i.e., the child processes after the terminated
445446
one in start order, are terminated. Then the terminated child
446447
process and the rest of the child processes are restarted.
448+
449+
In the above, process termination refers to unsuccessful termination, which
450+
is determined by the `:restart` option.
447451
448452
There is also a deprecated strategy called `:simple_one_for_one` which
449453
has been replaced by the `DynamicSupervisor`. The `:simple_one_for_one`

0 commit comments

Comments
 (0)