Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit b2c7076

Browse files
Be more defensive when requesting connection parameters
References #1538.
1 parent 0f96d56 commit b2c7076

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/rabbit_amqp_connection.erl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@ amqp_params(ConnPid, Timeout) ->
2323
P = try
2424
gen_server:call(ConnPid, {info, [amqp_params]}, Timeout)
2525
catch exit:{noproc, Error} ->
26-
rabbit_log:debug("file ~p, line ~p - connection process ~p not alive: ~p~n",
27-
[?FILE, ?LINE, ConnPid, Error]),
26+
rabbit_log:debug("file ~p, line ~p - connection process ~p not alive: ~p~n",
27+
[?FILE, ?LINE, ConnPid, Error]),
28+
[];
29+
_:Error ->
30+
rabbit_log:debug("file ~p, line ~p - failed to get amqp_params from connection process ~p: ~p~n",
31+
[?FILE, ?LINE, ConnPid, Error]),
2832
[]
2933
end,
3034
process_amqp_params_result(P).
3135

3236
process_amqp_params_result({error, {bad_argument, amqp_params}}) ->
33-
% Some connection process modules do not handle the {info, [amqp_params]}
34-
% message (like rabbit_reader) and throw a bad_argument error
37+
%% Some connection process modules do not handle the {info, [amqp_params]}
38+
%% message (like rabbit_reader) and throw a bad_argument error
3539
[];
3640
process_amqp_params_result({ok, AmqpParams}) ->
3741
AmqpParams;

0 commit comments

Comments
 (0)