Update ranch supervisor structure on list/0 command

This commit is contained in:
dcorbacho 2021-03-09 23:16:30 +01:00
parent d1c68ca8b9
commit e0d567828f
2 changed files with 11 additions and 13 deletions

View File

@ -153,14 +153,12 @@ emit_publisher_info_local(VHost, Items, Ref, AggregatorPid) ->
list(VHost)).
list(VHost) ->
[Client
|| {_, ListSupPid, _, _}
<- supervisor2:which_children(rabbit_stream_sup),
{_, RanchSup, supervisor, _}
<- supervisor2:which_children(ListSupPid),
{ranch_conns_sup, ConnSup, _, _}
<- supervisor:which_children(RanchSup),
{_, CliSup, _, _} <- supervisor:which_children(ConnSup),
{rabbit_stream_reader, Client, _, _}
<- supervisor:which_children(CliSup),
[Client ||
{_, ListSup, _, _} <- supervisor2:which_children(rabbit_stream_sup),
{_, RanchEmbeddedSup, supervisor, _} <- supervisor2:which_children(ListSup),
{{ranch_listener_sup, _}, RanchListSup, _, _} <- supervisor:which_children(RanchEmbeddedSup),
{ranch_conns_sup_sup, RanchConnsSup, supervisor, _} <- supervisor2:which_children(RanchListSup),
{_, RanchConnSup, supervisor, _} <- supervisor2:which_children(RanchConnsSup),
{_, StompClientSup, supervisor, _} <- supervisor2:which_children(RanchConnSup),
{rabbit_stream_reader, Client, _, _} <- supervisor:which_children(StompClientSup),
rabbit_stream_reader:in_vhost(Client, VHost)].

View File

@ -277,7 +277,7 @@ listen_loop_pre_auth(Transport,
#configuration{frame_max = FrameMax,
heartbeat = Heartbeat} =
Configuration) ->
{OK, Closed, Error} = Transport:messages(),
{OK, Closed, Error, _Passive} = Transport:messages(),
%% FIXME introduce timeout to complete the connection opening (after block should be enough)
receive
{OK, S, Data} ->
@ -379,7 +379,7 @@ listen_loop_post_auth(Transport,
CreditsRequiredForUnblocking} =
Configuration) ->
Connection = ensure_stats_timer(Connection0),
{OK, Closed, Error} = Transport:messages(),
{OK, Closed, Error, _Passive} = Transport:messages(),
receive
{OK, S, Data} ->
{Connection1, State1} =
@ -719,7 +719,7 @@ listen_loop_post_close(Transport,
#stream_connection{socket = S} = Connection,
State,
Configuration) ->
{OK, Closed, Error} = Transport:messages(),
{OK, Closed, Error, _Passive} = Transport:messages(),
%% FIXME demonitor streams
%% FIXME introduce timeout to complete the connection closing (after block should be enough)
receive