Skip to content

Commit 8093930

Browse files
committed
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.
1 parent eff64a2 commit 8093930

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

deps/amqp_client/src/amqp_channel.erl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -876,11 +876,8 @@ do(Method, Content, Flow, #state{driver = direct, writer = W}) ->
876876

877877

878878
flush_writer(#state{driver = network, writer = Writer}) ->
879-
try
880-
rabbit_writer:flush(Writer)
881-
catch
882-
exit:noproc -> ok
883-
end;
879+
_ = catch rabbit_writer:flush(Writer),
880+
ok;
884881
flush_writer(#state{driver = direct}) ->
885882
ok.
886883
amqp_msg(none) ->

0 commit comments

Comments
 (0)