Skip to content

Commit cb20d18

Browse files
dumbbellmergify[bot]
authored andcommitted
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. (cherry picked from commit 8945b75)
1 parent 15443b1 commit cb20d18

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").
@@ -748,6 +750,10 @@ handle_info({{'DOWN', QName}, _MRef, process, QPid, Reason},
748750
handle_eol(QRef, State)
749751
end;
750752

753+
handle_info({'DOWN', _MRef, process, Pid, normal}, State) ->
754+
?LOG_DEBUG("Process ~0p monitored by channel ~0p exited", [Pid, self()]),
755+
{noreply, State};
756+
751757
handle_info({'EXIT', _Pid, Reason}, State) ->
752758
{stop, Reason, State};
753759

0 commit comments

Comments
 (0)