Skip to content

By @tomyouyou: Avoid a scary log exception when a closing connection runs into an exception during a command writer flush operation (backport #14123) #14128

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 3 commits into from
Jun 25, 2025
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
7 changes: 6 additions & 1 deletion deps/rabbit/src/rabbit_channel.erl
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,12 @@ handle_cast(ready_for_close,
{stop, normal, State};

handle_cast(terminate, State = #ch{cfg = #conf{writer_pid = WriterPid}}) ->
ok = rabbit_writer:flush(WriterPid),
try
ok = rabbit_writer:flush(WriterPid)
catch
_Class:Reason ->
rabbit_log:debug("Failed to flush pending writes on a terminating connection, reason: ~tp", [Reason])
end,
{stop, normal, State};

handle_cast({command, #'basic.consume_ok'{consumer_tag = CTag} = Msg},
Expand Down
Loading