From 5823a6a220788070370022598e85a7011b88d178 Mon Sep 17 00:00:00 2001 From: Simon MacMullen Date: Tue, 13 Aug 2013 15:39:02 +0100 Subject: Silence the badarg on two near-simultaneous pauses. --- src/rabbit_node_monitor.erl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/rabbit_node_monitor.erl b/src/rabbit_node_monitor.erl index 0e6028c6..57dce7cd 100644 --- a/src/rabbit_node_monitor.erl +++ b/src/rabbit_node_monitor.erl @@ -386,10 +386,12 @@ run_outside_applications(Fun) -> %% If our group leader is inside an application we are about %% to stop, application:stop/1 does not return. group_leader(whereis(init), self()), - %% Ensure only one such process at a time, will - %% exit(badarg) (harmlessly) if one is already running - register(rabbit_outside_app_process, self()), - Fun() + %% Ensure only one such process at a time, the + %% exit(badarg) is harmless if one is already running + try register(rabbit_outside_app_process, self()) of + true -> Fun() + catch error:badarg -> ok + end end). wait_for_cluster_recovery(Nodes) -> -- cgit v1.2.1