[erlang-questions] Supervisor does not restart Gen Server

Adam Lindberg adam@REDACTED
Tue Feb 20 17:10:21 CET 2007


Have you started the gen_server with start_link? If you're using only
start the supervisor will never know that the server has crashed.

Cheers
Adam

On 2/20/07, Gurgen Tumanian <tumanian@REDACTED> wrote:
> Hello everybody.
>
> In my application i have a set of gen_servers orginized in a simple one
> level supervision tree, with  one superviser above all.  Now the problem
> that i have , is that once one of my gen_servers is crashed, the supervisor
> does not restart it, and what is even worse - dies himself.
> I have simplified the problem, creating a simple gen server in which a
> badarith can be initiated(divide by zero)  and a
> simple supervisor, which should have restarted it in case of crash by
> one_to_one strategy.
>
> now when starting the supervisor, and then calling the zuzu:do(0) (causing
> the badmatch)
> i get the crash of the worker gen_serv, and then the supervisor
> crashes.Supervior's crash report is
> =CRASH REPORT==== 20-Feb-2007::16:35:12 ===
>   crasher:
>     pid: <0.41.0>
>     registered_name: []
>     error_info: {{badarith,[{zuzu,handle_call,3},
>                              {gen_server,handle_msg,6},
>                              {proc_lib,init_p,5}]},
>
> {gen_server,call,[zuzu_serv,{do,0},35000]}}
>     initial_call: {gen,init_it,
>                       [gen_server,
>                        <0.39.0>,
>                        <0.39.0>,
>                        supervisor,
>                        {self,bubu,[]},
>                        []]}
>     ancestors: [<0.39.0>]
>     messages: []
>     links: []
>     dictionary: []
>     trap_exit: true
>     status: running
>     heap_size: 233
>     stack_size: 21
>     reductions: 227
>   neighbours:
>
> I get the feeling that the supervisor dies as it pasess the restart limit,
> but that's a quite surprise for me, as the first start of the worker proc
> pases normally.
> I will be greatfull for any advice on this issue.
>
> Regards
> Gurgen Tumanyan, Smart Tech
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
>


-- 
Adam Lindberg
Mobile: +46734228920



More information about the erlang-questions mailing list