From 8945b75322d5f04909c3670e62b5ca468c4949ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Thu, 13 Feb 2025 18:33:40 +0100 Subject: [PATCH] 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. --- deps/rabbit/src/rabbit_channel.erl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deps/rabbit/src/rabbit_channel.erl b/deps/rabbit/src/rabbit_channel.erl index 28eef707dc..0b913c4062 100644 --- a/deps/rabbit/src/rabbit_channel.erl +++ b/deps/rabbit/src/rabbit_channel.erl @@ -36,6 +36,8 @@ %% When a queue is declared as exclusive on a channel, the channel %% will notify queue collector of that queue. +-include_lib("kernel/include/logger.hrl"). + -include_lib("rabbit_common/include/rabbit_framing.hrl"). -include_lib("rabbit_common/include/rabbit.hrl"). -include_lib("rabbit_common/include/rabbit_misc.hrl"). @@ -729,6 +731,10 @@ handle_info({{'DOWN', QName}, _MRef, process, QPid, Reason}, handle_eol(QRef, State) end; +handle_info({'DOWN', _MRef, process, Pid, normal}, State) -> + ?LOG_DEBUG("Process ~0p monitored by channel ~0p exited", [Pid, self()]), + {noreply, State}; + handle_info({'EXIT', _Pid, Reason}, State) -> {stop, Reason, State};