amqp_channel: Ignore all exceptions from `rabbit_writer:flush/1`

[Why]
The writer process could still be exiting at the time flush is called.
For instance, the reason could be `{shutdown, _}`.

Also, with the conversion of the `rabbit_writer` to a gen_server, the
noproc reason would be `{noproc, _}`.

[How]
`flush_writer/1` is called in the channel `terminate/2` function, so we
don't really care about any writer errors at this point. Let's ignore
any exceptions.
This commit is contained in:
Jean-Sébastien Pédron 2023-12-13 12:07:39 +01:00
parent eff64a2d96
commit 8093930445
No known key found for this signature in database
GPG Key ID: 39E99761A5FD94CC
1 changed files with 2 additions and 5 deletions

View File

@ -876,11 +876,8 @@ do(Method, Content, Flow, #state{driver = direct, writer = W}) ->
flush_writer(#state{driver = network, writer = Writer}) ->
try
rabbit_writer:flush(Writer)
catch
exit:noproc -> ok
end;
_ = catch rabbit_writer:flush(Writer),
ok;
flush_writer(#state{driver = direct}) ->
ok.
amqp_msg(none) ->