From 70cce4592d5239cfbc2c1227c92515456fe3450f Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Fri, 24 May 2024 19:53:33 -0400 Subject: [PATCH] Make rabbit_misc:which_applications/0 more resilient In certain shutdown scenarios this function on Erlang 26 runs into exceptions that stem from application_controller. The objective of this function is to be an exception-safe version of application:which_applications/1, so let's handle more cases. This helps certain test suites avoid exceptions (process crash reports) logged during shutdown, which makes CT helpers fail test run even though there were no exceptions in RabbitMQ itself, and all the exception indicates is a certain edge case (during system shutdown) that application_controller does not care to handle. (cherry picked from commit ca094402a9009ef2ee9f2b8ec04be585694297ff) (cherry picked from commit addc990ac38fb51ce66762753c623aad35bd4d8b) --- deps/rabbit_common/src/rabbit_misc.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/rabbit_common/src/rabbit_misc.erl b/deps/rabbit_common/src/rabbit_misc.erl index 7139ce17c5d7..2eecbbcad241 100644 --- a/deps/rabbit_common/src/rabbit_misc.erl +++ b/deps/rabbit_common/src/rabbit_misc.erl @@ -1141,8 +1141,8 @@ rabbitmq_and_erlang_versions() -> which_applications() -> try application:which_applications(10000) - catch - exit:{timeout, _} -> [] + catch _:_:_Stacktrace -> + [] end. sequence_error([T]) -> T;