Skip to content

Commit 7bee3c4

Browse files
committed
rabbit_channel: Ignore DOWN message from monitored process if it exited normally
[Why] It happens in CI from time to time and it was crashing the channel process. There is always a `channel.close` method pending in the channel mailbox. [How] For now, log something and ignore the DOWN message. The channel will exit after handling the pending `channel.close` method anyway.
1 parent d14aa07 commit 7bee3c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

deps/rabbit/src/rabbit_channel.erl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
%% When a queue is declared as exclusive on a channel, the channel
3737
%% will notify queue collector of that queue.
3838

39+
-include_lib("kernel/include/logger.hrl").
40+
3941
-include_lib("rabbit_common/include/rabbit_framing.hrl").
4042
-include_lib("rabbit_common/include/rabbit.hrl").
4143
-include_lib("rabbit_common/include/rabbit_misc.hrl").
@@ -729,6 +731,10 @@ handle_info({{'DOWN', QName}, _MRef, process, QPid, Reason},
729731
handle_eol(QRef, State)
730732
end;
731733

734+
handle_info({'DOWN', _MRef, process, Pid, normal}, State) ->
735+
?LOG_DEBUG("Process ~0p monitored by channel ~0p exited", [Pid, self()]),
736+
{noreply, State};
737+
732738
handle_info({'EXIT', _Pid, Reason}, State) ->
733739
{stop, Reason, State};
734740

0 commit comments

Comments
 (0)