Skip to content

Commit 08923ac

Browse files
rabbit_connection_tracking_handler: handle more errors when registering a connection
Due to #1869, a connection can be accepted before connection tracking tables were initialized/synced from a peer. The handler should log a warning and not terminate, even if it would be restarted, to reduce log noise and scare fewer operators for no real reason: the condition is transient and should not normally last for more than a few tenths of a second.
1 parent d4a02d9 commit 08923ac

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/rabbit_connection_tracking_handler.erl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ handle_event(#event{type = connection_created, props = Details}, State) ->
5858
rabbit_connection_tracking:tracked_connection_from_connection_created(Details)
5959
)
6060
catch
61-
error:{no_exists,_} ->
62-
rabbit_log_connection:error("Failed to track new connection, it terminated prematurely"),
61+
error:{no_exists, _} ->
62+
Msg = "Could not register connection ~p for tracking, "
63+
"its table is not ready yet or the connection terminated prematurely",
64+
rabbit_log_connection:warning(Msg, [pget(pid, Details)]),
65+
ok;
66+
error:Err ->
67+
Msg = "Could not register connection ~p for tracking: ~p",
68+
rabbit_log_connection:warning(Msg, [pget(pid, Details), Err]),
6369
ok
6470
end;
6571
_OtherNode ->

0 commit comments

Comments
 (0)