Skip to content

Commit 663f213

Browse files
committed
Use tracked connection ID in error message
1 parent 08923ac commit 663f213

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/rabbit_connection_tracking_handler.erl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,24 @@ handle_event(#event{type = connection_created, props = Details}, State) ->
5353
ThisNode = node(),
5454
case pget(node, Details) of
5555
ThisNode ->
56+
TConn = rabbit_connection_tracking:tracked_connection_from_connection_created(Details),
57+
ConnId = TConn#tracked_connection.id,
5658
try
57-
rabbit_connection_tracking:register_connection(
58-
rabbit_connection_tracking:tracked_connection_from_connection_created(Details)
59-
)
59+
rabbit_connection_tracking:register_connection(TConn)
6060
catch
6161
error:{no_exists, _} ->
6262
Msg = "Could not register connection ~p for tracking, "
6363
"its table is not ready yet or the connection terminated prematurely",
64-
rabbit_log_connection:warning(Msg, [pget(pid, Details)]),
64+
rabbit_log_connection:warning(Msg, [ConnId]),
6565
ok;
6666
error:Err ->
6767
Msg = "Could not register connection ~p for tracking: ~p",
68-
rabbit_log_connection:warning(Msg, [pget(pid, Details), Err]),
68+
rabbit_log_connection:warning(Msg, [ConnId, Err]),
6969
ok
7070
end;
71-
_OtherNode ->
72-
%% ignore
73-
ok
71+
_OtherNode ->
72+
%% ignore
73+
ok
7474
end,
7575
{ok, State};
7676
handle_event(#event{type = connection_closed, props = Details}, State) ->

0 commit comments

Comments
 (0)