Skip to content

Commit 7ec3703

Browse files
Merge pull request #14123 from rabbitmq/rabbitmq-server-14121
By @tomyouyou: Avoid a scary log exception when a closing connection runs into an exception during a command writer flush operation
2 parents d370b52 + b4a11e6 commit 7ec3703

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

deps/rabbit/src/rabbit_channel.erl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,12 @@ handle_cast(ready_for_close,
639639
{stop, normal, State};
640640

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

645650
handle_cast({command, #'basic.consume_ok'{consumer_tag = CTag} = Msg},

0 commit comments

Comments
 (0)