summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-09-28 16:53:25 +0100
committerSimon MacMullen <simon@rabbitmq.com>2012-09-28 16:53:25 +0100
commit8cf46d75ddf80121a7c1da695ba493e0e3275236 (patch)
treec36322a56caea7ba4527b08ad8a3f6361cac30c6 /src
parent49cc7ceb0cbff85ce9e14b862a75ada132902fe0 (diff)
downloadrabbitmq-server-git-8cf46d75ddf80121a7c1da695ba493e0e3275236.tar.gz
Ignore if the node is down.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_mirror_queue_misc.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rabbit_mirror_queue_misc.erl b/src/rabbit_mirror_queue_misc.erl
index 8c75ab02e4..a0b0316668 100644
--- a/src/rabbit_mirror_queue_misc.erl
+++ b/src/rabbit_mirror_queue_misc.erl
@@ -163,11 +163,19 @@ add_mirror(QName, MirrorNode) ->
end).
start_child(Name, MirrorNode, Q) ->
- case catch rabbit_mirror_queue_slave_sup:start_child(MirrorNode, [Q]) of
+ case rabbit_misc:with_exit_handler(
+ rabbit_misc:const({ok, down}),
+ fun () ->
+ rabbit_mirror_queue_slave_sup:start_child(MirrorNode, [Q])
+ end) of
{ok, undefined} ->
%% this means the mirror process was
%% already running on the given node.
ok;
+ {ok, down} ->
+ %% Node went down between us deciding to start a mirror
+ %% and actually starting it. Which is fine.
+ ok;
{ok, SPid} ->
rabbit_log:info("Adding mirror of ~s on node ~p: ~p~n",
[rabbit_misc:rs(Name), MirrorNode, SPid]),