Supervision Trees - A Beginner Writes
Gordon Guthrie, BTP, BT, SE
Thu Jan 15 12:05:54 CET 2004
I am writing my first supervision tree. I have an application which starts a
simple one-for-one supervisor.
This supervisor starts workers. The intention is that each worker will
eventually handle an http session, so I am starting them as transients.
These processes will die when the user session they support times out, so
each worker spawns a linked timeout process which periodically messages its
worker "if you haven't done anything since last time then exit".
The problem I have is that when the worker exits (either normal or a custom
timeout message) the supervisor and then the application both exit.
I can see that there might be circumstances that would kill a worker in
which a supervisor might also want to terminate for a clean restart.
So my question is how do I (under OTP) handle the exit message that results
from the spawn_link to the child. In a 'homebrew' supervision tree (ie last
week) I would have just trapped exits...
Scottish Enterprise Network
Address & Contact Numbers
5 Atlantic Quay
Tel: +44 (0)141 248 2700.
Fax: +44 (0)141 221 3217
message is sent in confidence for the addressee only.
It may contain legally privileged information. The contents are not to
be disclosed to anyone other than the addressee. Unauthorised recipients
are requested to preserve this confidentiality and to advise the sender
immediately of any error in transmission.
More information about the erlang-questions