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.<div>
<br></div><div>I also realized I probably dont need to supervise cowboy under my own supervisor as it already has its own supervision.</div><div><br></div><div>-AD<br><br></div><div><div class="gmail_quote">On Sat, May 5, 2012 at 7:26 PM, Per Melin <span dir="ltr"><<a href="mailto:per.melin@gmail.com" target="_blank">per.melin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On May 6, 2012, at 00:40 , Robert Virding wrote:<br>
<br>
>> Since cowboy_sup received an exit signal of 'killed' from<br>
>> cowboy_listener_sup, doesn't that imply that it was (explicitly)<br>
>> killed with exit(Pid, kill)?<br>
><br>
> 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?<br>

<br>
</div>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?<br>

<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
>>>><br>
>>>> I have a gen_server that seems to be crashing for some reason and<br>
>>>> the supservisor is not restarting it.  The child spec is<br>
>>>> one_for_one, permanent and the error log is below.  All i see is<br>
>>>> the crash report but no attempt at a restart.  Is there any way<br>
>>>> to figure out why the supervisor would not restart it?<br>
>>>><br>
>>>> 2012-05-02 14:54:28.776 [info]<br>
>>>> <0.889.0>@websocket_pubsubsrv:terminate:198 Shutting down pubsub<br>
>>>> server...<br>
>>>> 2012-05-02 14:54:28.776 [error] <0.882.0> Supervisor cowboy_sup<br>
>>>> had child {cowboy_listener_sup,my_http_listener} started with<br>
>>>> cowboy_listener_sup:start_link(100, cowboy_tcp_transport,<br>
>>>> [{port,8000}], cowboy_http_protocol,<br>
>>>> [{dispatch,[{'_',[{[<<"multiplex">>,'...'],sockjs_cowboy_handler,{service,"/multiplex",sockjs_multiplex,...}},...]}]}])<br>
>>>> at <0.909.0> exit with reason killed in context child_terminated<br>
>>>> 2012-05-02 14:54:28.785 [error] <0.911.0> gen_server <0.911.0><br>
>>>> terminated with reason: killed<br>
>>>> 2012-05-02 14:54:28.788 [error] <0.911.0> CRASH REPORT Process<br>
>>>> <0.911.0> with 1 neighbours crashed with reason:<br>
>>>> {killed,[{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}<br>
>>>><br>
>>>><br>
>>>> Thanks<br>
>>>> -AD<br>
<br>
</div></div></blockquote></div><br></div>