gen_server can't trap 'EXIT' from parent

Vlad Dumitrescu vlad_dumitrescu@REDACTED
Mon Jan 10 22:24:44 CET 2005

--- Original Message ----- 
From: "Fredrik Thulin" <ft@REDACTED>
> Right! That explains it. If the 'EXIT' comes from your gen_servers
> parent (almost always your supervisor I guess) then you can't trap it!


Your gen_server gets notified that the parent creshed: terminate is called. 
You can do whatever you need to do there, instead of inside handle_info. 
It's just the same, since the gen_server should probably exit too.

Just remember to do a
    case Reason of ...
in terminate, to find out if it was a crash or a normal shutdown. (I forgot 
at one time and was very confused afterwards :-)


More information about the erlang-questions mailing list