[erlang-questions] clarify: gen_server:start_link/3 return values?

Aggelos Giantsios aggelgian@REDACTED
Thu Apr 25 15:12:48 CEST 2013


On Thu, Apr 25, 2013 at 3:45 PM, Bengt Kleberg
<bengt.kleberg@REDACTED>wrote:

> Would it not be consistent with the documentation if the return values
> {stop, Reason} or ignore, from init/1, would not cause a call to
> erlang:exit/1 ?
>
>
> bengt
>

The call to erlang:exit/1 is necessary as the spawned process must be
terminated. The problem is that the link between the parent and the child
process still exists after proc_lib:init_ack/2 returns.
I suppose that if you want the behaviour to match the documentation, there
should be a call to erlang:unlink/1 before raising the exception and
crashing the spawned process.
However, I do not know if the present behaviour is by design or a bug.
Maybe someone from the OTP team can shed some light on this.

Aggelos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130425/9eac68b3/attachment.htm>


More information about the erlang-questions mailing list