I have a question about timing of monitored/linked process dying, and I can't think of how to test it in practice. Here is the scenario I am worried about.
Let's say I have a process called master
and slave
.
master
setstrap_exit
totrue
.master
does{ok, Pid} = slave:start_link()
thus linking the two.master
does the equivalent ofgen_server:call(Pid, Msg)
.- Before the message arrives at
Pid
that process crashes.
Question:
- Will
master
receive anEXIT
message first? or - Will
master
fail with{noproc,{gen_server..
exception sincePid
is already dead?