Gen processes and exit/2 from shell

Ulf Wiger etxuwig@REDACTED
Tue Dec 17 11:43:47 CET 2002


On 17 Dec 2002, Luke Gorrie wrote:

>It is a special case in gen_server:loop/6 that if your
>parent process (the one that spawned you) dies then you
>have to terminate, even if you're trapping exits. I guess
>the intention is to use a reliable parent like a
>supervisor, and not outlive it.
>
>When you use exit/2 from the shell it will get an {'EXIT',
>ShellPid, Rsn} signal - so if ShellPid == Parent (who
>spawned the server) then you would hit the special case.
>
>-Luke

This is a really annoying feature when testing a server from
the shell. What I usually do when playing around in the
shell is:

- {ok,Pid} = Server:start_link(...).
- unlink(Pid).

...and then get on with the testing.

/Uffe
-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson Telecom AB, ATM Multiservice Networks




More information about the erlang-questions mailing list