diff --git a/deps/rabbit/src/rabbit_channel.erl b/deps/rabbit/src/rabbit_channel.erl index 86d71d7af902..514903fe66ae 100644 --- a/deps/rabbit/src/rabbit_channel.erl +++ b/deps/rabbit/src/rabbit_channel.erl @@ -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},