Supervisor shutdown

Vlad Dumitrescu vlad_dumitrescu@REDACTED
Tue Nov 25 13:44:55 CET 2003


From: "Ulf Wiger" <ulf.wiger@REDACTED>
> Yes, but there is a small quirk in the gen_server.erl module that
> causes it not to heed the shutdown protocol if started with
> gen_server:start(), even if you _do_ create the link in some other
> way. From the supervisor side, everything is fine, but the gen_server
> doesn't recognise the supervisor as its parent.
>
> So, when the child is a gen_server, the start function must be
> {gen_server, start_link, [...]} in order for everything to
> work correctly.
>
> The same goes for gen_fsm and gen_event.

Okay, now I see... This should be documented, I think, because using supervisors
may be confusing enough even whithout hidden inconsistencies.

In any case it's probably safer to always use start_link and perhaps unlinking
afterwards, than using start and linking later.

regards,
Vlad



More information about the erlang-questions mailing list