extend/ranch — pull request #13 by keynslug (2012-11-02 10:47:17+00:00)
Title: Fixed pids in child specifications

It seems that this issue is still reproducible:
(https://github.com/extend/cowboy/issues/239)

At least I could force supervisor which supervises listener_sup itself to restart by forcibly closing the listening socket. So then I got this in shell:
```
1> P = lists:last(erlang:ports()).
#Port<0.6816>
2> gen_tcp:close(P).
ok
...
[error] Supervisor ranch_listener_sup had child ranch_acceptors_sup started with ranch_acceptors_sup:start_link(http_listener, 12, ranch_tcp, [{ip,{127,0,0,1}}, ...], cowboy_protocol, <0.118.0>, <0.119.0>) at <0.120.0> exit with reason shutdown in context child_terminated
[debug] Supervisor ranch_listener_sup started ranch_listener:start_link(http_listener, 1024, [{dispatch, ...}]) at pid <0.169.0>
[debug] Supervisor ranch_listener_sup started ranch_conns_sup:start_link() at pid <0.170.0>
[error] Supervisor ranch_acceptors_sup had child {acceptor,<0.171.0>,1} started with ranch_acceptor:start_link(http_listener, #Port<0.7012>, ranch_tcp, cowboy_protocol, <0.118.0>, <0.119.0>) at undefined exit with reason {'EXIT',{noproc,{gen_server,call,[<0.118.0>,get_max_connections]}}} in context start_error
[error] Supervisor ranch_listener_sup had child ranch_acceptors_sup started with ranch_acceptors_sup:start_link(http_listener, 12, ranch_tcp, [{ip,{127,0,0,1}},{port,31338},{poolsize,12}], cowboy_protocol, <0.118.0>, <0.119.0>) at undefined exit with reason shutdown in context start_error
[debug] Supervisor ranch_listener_sup started ranch_listener:start_link(http_listener, 1024, [{dispatch, ...}]) at pid <0.173.0>
[debug] Supervisor ranch_listener_sup started ranch_conns_sup:start_link() at pid <0.174.0>
[error] Supervisor ranch_acceptors_sup had child {acceptor,<0.175.0>,1} started with ranch_acceptor:start_link(http_listener, #Port<0.7013>, ranch_tcp, cowboy_protocol, <0.118.0>, <0.119.0>) at undefined exit with reason {'EXIT',{noproc,{gen_server,call,[<0.118.0>,get_max_connections]}}} in context start_error
...
```