[erlang-questions] supervisor not restarting gen_server

AD straightflush@REDACTED
Sun May 6 04:49:53 CEST 2012


i had a supervisor behaviour starting the gen_server and the cowboy_sup as
2 child specs.  Each was a standard one_for_one permanent although I now
realize I had the cowboy PID set to worker instead of supervisor which
probably caused some issues.

I also realized I probably dont need to supervise cowboy under my own
supervisor as it already has its own supervision.

-AD

On Sat, May 5, 2012 at 7:26 PM, Per Melin <per.melin@REDACTED> wrote:

> On May 6, 2012, at 00:40 , Robert Virding wrote:
>
> >> Since cowboy_sup received an exit signal of 'killed' from
> >> cowboy_listener_sup, doesn't that imply that it was (explicitly)
> >> killed with exit(Pid, kill)?
> >
> > That is most definitely does. And if the supervisor was killed then that
> would also have killed the gen_server which would not be restarted as there
> was no supervisor. The question is then why that supervisor was not
> restarted by cowboy_sup?
>
> I asked myself that too, but are we sure it wasn't? If AD's gen_server was
> dynamically started (supervisor:start_child/2) as a descendant to
> cowboy_listener_sup it could not be started again since that information
> would now be lost. So it's back to your original question; where is that
> process started?
>
>
>
> >>>>
> >>>> I have a gen_server that seems to be crashing for some reason and
> >>>> the supservisor is not restarting it.  The child spec is
> >>>> one_for_one, permanent and the error log is below.  All i see is
> >>>> the crash report but no attempt at a restart.  Is there any way
> >>>> to figure out why the supervisor would not restart it?
> >>>>
> >>>> 2012-05-02 14:54:28.776 [info]
> >>>> <0.889.0>@websocket_pubsubsrv:terminate:198 Shutting down pubsub
> >>>> server...
> >>>> 2012-05-02 14:54:28.776 [error] <0.882.0> Supervisor cowboy_sup
> >>>> had child {cowboy_listener_sup,my_http_listener} started with
> >>>> cowboy_listener_sup:start_link(100, cowboy_tcp_transport,
> >>>> [{port,8000}], cowboy_http_protocol,
> >>>>
> [{dispatch,[{'_',[{[<<"multiplex">>,'...'],sockjs_cowboy_handler,{service,"/multiplex",sockjs_multiplex,...}},...]}]}])
> >>>> at <0.909.0> exit with reason killed in context child_terminated
> >>>> 2012-05-02 14:54:28.785 [error] <0.911.0> gen_server <0.911.0>
> >>>> terminated with reason: killed
> >>>> 2012-05-02 14:54:28.788 [error] <0.911.0> CRASH REPORT Process
> >>>> <0.911.0> with 1 neighbours crashed with reason:
> >>>> {killed,[{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}
> >>>>
> >>>>
> >>>> Thanks
> >>>> -AD
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120505/070f5025/attachment.htm>


More information about the erlang-questions mailing list