From 2c4e984bd1d75524fd6444dc2032f8d758a945ae Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 6 Sep 2011 11:10:43 +0200 Subject: Allow an infinite timeout to shutdown worker processes Now, in child specification, the shutdown value can also be set to infinity for worker children. This restriction was removed because this is not always possible to predict the shutdown time for a worker. This is highly application-dependent. --- lib/stdlib/doc/src/supervisor.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/stdlib/doc') diff --git a/lib/stdlib/doc/src/supervisor.xml b/lib/stdlib/doc/src/supervisor.xml index ec607d6e4c..b4baf2f0a0 100644 --- a/lib/stdlib/doc/src/supervisor.xml +++ b/lib/stdlib/doc/src/supervisor.xml @@ -169,7 +169,8 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules} exit(Child,kill).

If the child process is another supervisor, Shutdown should be set to infinity to give the subtree ample - time to shutdown.

+ time to shutdown. It is also allowed to set it to infinity, + if the child process is a worker.

Important note on simple-one-for-one supervisors: The dynamically created child processes of a simple-one-for-one supervisor are not explicitly killed, -- cgit v1.2.3 From 9679510bb27b569fd47394b6cb319916c3282de9 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 14 Sep 2011 14:30:47 +0200 Subject: Add a warning to docs about workers' shutdown strategy --- lib/stdlib/doc/src/supervisor.xml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/stdlib/doc') diff --git a/lib/stdlib/doc/src/supervisor.xml b/lib/stdlib/doc/src/supervisor.xml index b4baf2f0a0..54e7cab884 100644 --- a/lib/stdlib/doc/src/supervisor.xml +++ b/lib/stdlib/doc/src/supervisor.xml @@ -171,6 +171,13 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules} should be set to infinity to give the subtree ample time to shutdown. It is also allowed to set it to infinity, if the child process is a worker.

+ +

Be careful by setting the Shutdown strategy to + infinity 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.

+

Important note on simple-one-for-one supervisors: The dynamically created child processes of a simple-one-for-one supervisor are not explicitly killed, -- cgit v1.2.3