Skip to content

Prevent exchange logging crash (backport #12104) (backport #12105) #12107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions deps/rabbit/src/rabbit_logger_exchange_h.erl
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,18 @@ log(#{meta := #{mfa := {?MODULE, _, _}}}, _) ->
ok;
log(LogEvent, Config) ->
case rabbit_boot_state:get() of
ready -> do_log(LogEvent, Config);
_ -> ok
ready ->
try
do_log(LogEvent, Config)
catch
C:R:S ->
%% don't let logging crash, because then OTP logger
%% removes the logger_exchange handler, which in
%% turn deletes the log exchange and its bindings
erlang:display({?MODULE, crashed, {C, R, S}})
end,
ok;
_ -> ok
end.

do_log(LogEvent, #{config := #{exchange := Exchange}} = Config) ->
Expand Down
Loading