diff --git a/deps/rabbitmq_amqp1_0/src/rabbit_amqp1_0.erl b/deps/rabbitmq_amqp1_0/src/rabbit_amqp1_0.erl index a7ea20d46661..f4140b9daf4d 100644 --- a/deps/rabbitmq_amqp1_0/src/rabbit_amqp1_0.erl +++ b/deps/rabbitmq_amqp1_0/src/rabbit_amqp1_0.erl @@ -33,8 +33,10 @@ connection_info_local(Items) -> list() -> [ReaderPid || {_, TcpPid, _, [tcp_listener_sup]} <- supervisor:which_children(rabbit_sup), - {_, RanchLPid, _, [ranch_listener_sup]} <- supervisor:which_children(TcpPid), - {_, RanchCPid, _, [ranch_conns_sup]} <- supervisor:which_children(RanchLPid), + {_, RanchEPid, _, [ranch_embedded_sup]} <- supervisor:which_children(TcpPid), + {_, RanchLPid, _, [ranch_listener_sup]} <- supervisor:which_children(RanchEPid), + {_, RanchCSPid, _, [ranch_conns_sup_sup]} <- supervisor:which_children(RanchLPid), + {_, RanchCPid, _, [ranch_conns_sup]} <- supervisor:which_children(RanchCSPid), {rabbit_connection_sup, ConnPid, _, _} <- supervisor:which_children(RanchCPid), {reader, ReaderPid, _, _} <- supervisor:which_children(ConnPid) ]. diff --git a/deps/rabbitmq_amqp1_0/src/rabbit_amqp1_0_reader.erl b/deps/rabbitmq_amqp1_0/src/rabbit_amqp1_0_reader.erl index b4073580feb2..4ba57f9c2c11 100644 --- a/deps/rabbitmq_amqp1_0/src/rabbit_amqp1_0_reader.erl +++ b/deps/rabbitmq_amqp1_0/src/rabbit_amqp1_0_reader.erl @@ -187,6 +187,7 @@ handle_other({bump_credit, Msg}, State) -> handle_other(terminate_connection, State) -> State; handle_other({info, InfoItems, Pid}, State) -> + logger:info("Reader info: State: ~p pid ~p infoitems: ~p ", [State, Pid, InfoItems]), Infos = lists:map( fun(InfoItem) -> {InfoItem, info_internal(InfoItem, State)} diff --git a/deps/rabbitmq_amqp1_0/test/command_SUITE.erl b/deps/rabbitmq_amqp1_0/test/command_SUITE.erl index 4beb63a4e430..974f24cbed97 100644 --- a/deps/rabbitmq_amqp1_0/test/command_SUITE.erl +++ b/deps/rabbitmq_amqp1_0/test/command_SUITE.erl @@ -96,6 +96,45 @@ when_one_connection(_Config) -> rabbit_ct_broker_helpers:rpc(_Config, A, rabbit_connection_tracking, list, []), + [P1, P2] = [P + || {_, P, _, [tcp_listener_sup]} <- rabbit_ct_broker_helpers:rpc(_Config, A, supervisor,which_children, [rabbit_sup])], + println("Pid1", P1), + println("Pid2", P2), + + Children1 = rabbit_ct_broker_helpers:rpc(_Config, A, supervisor,which_children,[P1]), + println("tcp_listener_sup1", Children1), + Children2 = rabbit_ct_broker_helpers:rpc(_Config, A, supervisor,which_children,[P2]), + println("tcp_listener_sup2", Children2), + + [Res1, Res2] = [RanchSupPid + || {_, TcpPid, _, [tcp_listener_sup]} <- rabbit_ct_broker_helpers:rpc(_Config, A, supervisor, which_children, [rabbit_sup]), + {_, RanchSupPid, _, [ranch_embedded_sup]} <- rabbit_ct_broker_helpers:rpc(_Config, A, supervisor, which_children, [TcpPid]) + ], + println("ranch_embedded_sup 1", rabbit_ct_broker_helpers:rpc(_Config, A, supervisor,which_children,[Res1])), + println("ranch_embedded_sup 2", rabbit_ct_broker_helpers:rpc(_Config, A, supervisor,which_children,[Res2])), + + [Rl1, Rl2] = [RanchLPid + || {_, TcpPid, _, [tcp_listener_sup]} <- rabbit_ct_broker_helpers:rpc(_Config, A, supervisor, which_children, [rabbit_sup]), + {_, RanchEPid, _, [ranch_embedded_sup]} <- rabbit_ct_broker_helpers:rpc(_Config, A, supervisor, which_children, [TcpPid]), + {_, RanchLPid, _, [ranch_listener_sup]} <- rabbit_ct_broker_helpers:rpc(_Config, A, supervisor, which_children, [RanchEPid]) + ], + println("ranch_listener_sup", [Rl1, Rl2]), + println("ranch_listener_sup 1", rabbit_ct_broker_helpers:rpc(_Config, A, supervisor,which_children,[Rl1])), + println("ranch_listener_sup 2", rabbit_ct_broker_helpers:rpc(_Config, A, supervisor,which_children,[Rl2])), + + ReaderPids = [ReaderPid + || {_, TcpPid, _, [tcp_listener_sup]} <- rabbit_ct_broker_helpers:rpc(_Config, A, supervisor, which_children, [rabbit_sup]), + {_, RanchEPid, _, [ranch_embedded_sup]} <- rabbit_ct_broker_helpers:rpc(_Config, A, supervisor, which_children, [TcpPid]), + {_, RanchLPid, _, [ranch_listener_sup]} <- rabbit_ct_broker_helpers:rpc(_Config, A, supervisor, which_children, [RanchEPid]), + {_, RanchSPid, _, [ranch_conns_sup_sup]} <- rabbit_ct_broker_helpers:rpc(_Config, A, supervisor, which_children, [RanchLPid]), + {_, RanchCPid, _, [ranch_conns_sup]} <- rabbit_ct_broker_helpers:rpc(_Config, A, supervisor, which_children, [RanchSPid]), + {rabbit_connection_sup, ConnPid, _, _} <- supervisor:which_children(RanchCPid), + {reader, ReaderPid, _, _} <- supervisor:which_children(ConnPid) + ], + println("ReaderPid", ReaderPids), + ReaderInfos = [rabbit_ct_broker_helpers:rpc(_Config, A, rabbit_amqp1_0_reader, info, [Pid, [node,user]]) || Pid <- ReaderPids], + println("ReaderPid info",ReaderInfos), + [ExpectedConnection] = 'Elixir.Enum':to_list(?COMMAND:run([], Opts)), close_amqp10_connection(Connection).