Send shutdown message to non network/direct connection
Connections to the stream plugin does not have a type, so they can trigger some function_clause errors. This was the case when trying to close a connection from rabbit_connection_tracking module. The function now falls back to a simple gen_server call to the connection process for connections without a type.
This commit is contained in:
parent
c51e060a07
commit
db5a5f57e8
|
|
@ -512,4 +512,8 @@ close_connection(#tracked_connection{pid = Pid, type = network}, Message) ->
|
|||
close_connection(#tracked_connection{pid = Pid, type = direct}, Message) ->
|
||||
%% Do an RPC call to the node running the direct client.
|
||||
Node = node(Pid),
|
||||
rpc:call(Node, amqp_direct_connection, server_close, [Pid, 320, Message]).
|
||||
rpc:call(Node, amqp_direct_connection, server_close, [Pid, 320, Message]);
|
||||
close_connection(#tracked_connection{pid = Pid}, Message) ->
|
||||
% best effort, this will work for connections to the stream plugin
|
||||
Node = node(Pid),
|
||||
rpc:call(Node, gen_server, call, [Pid, {shutdown, Message}, infinity]).
|
||||
|
|
|
|||
Loading…
Reference in New Issue