[erlang-questions] gen_server question

Howard Yeh <>
Tue Jan 13 06:45:47 CET 2009


> 2009/1/12 Ryan Lepidi <>:
> Hello,
>
> When the server is terminated due to an error occurring in one of its
> functions, what happens if another process calls one of the server's
> functions in between the time the server is terminated and the time the
> supervisor restarts it?

Hi Ryan,

correct me if i am wrong:

messages are dropped if the receiving process is dead.

with gen_server, if you use synchronized call, you can specify a timeout value

gen_server:call(ServerRef, Request, Timeout)

"The call may fail for several reasons, including timeout and the
called gen_server dying before or during the call."

I think you get either a badarg (pid doesn't exist (as it's dead)) or
timeout (if the process died after message had been sent)

>Will the call be queued and executed once the server
> is back up?

no

> Or is there a chance that it could be lost?

yes

Howard
>
> Thanks.
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list