Skip to content

Commit

Permalink
Add a warning to docs about workers' shutdown strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Faulet authored and proxyles committed Oct 10, 2011
1 parent 2c4e984 commit 9679510
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/stdlib/doc/src/supervisor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
should be set to <c>infinity</c> to give the subtree ample
time to shutdown. It is also allowed to set it to <c>infinity</c>,
if the child process is a worker.</p>
<warning>
<p>Be careful by setting the <c>Shutdown</c> strategy to
<c>infinity</c> when the child process is a worker. Because, in this
situation, the termination of the supervision tree depends on the
child process, it must be implemented in a safe way and its cleanup
procedure must always return.</p>
</warning>
<p><em>Important note on simple-one-for-one supervisors:</em>
The dynamically created child processes of a
simple-one-for-one supervisor are not explicitly killed,
Expand Down
7 changes: 7 additions & 0 deletions system/doc/design_principles/sup_princ.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ init(...) ->
shutdown. It is also allowed to set it to <c>infinity</c>, if the
child process is a worker.</item>
</list>
<warning>
<p>Be careful by setting the <c>Shutdown</c> strategy to
<c>infinity</c> when the child process is a worker. Because, in this
situation, the termination of the supervision tree depends on the
child process, it must be implemented in a safe way and its cleanup
procedure must always return.</p>
</warning>
</item>
<item>
<p><c>Type</c> specifies if the child process is a supervisor or
Expand Down

0 comments on commit 9679510

Please sign in to comment.