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
This commit is contained in:
Michael Klishin 2025-06-25 17:38:24 +04:00 committed by GitHub
commit 7ec370347c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -639,7 +639,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},