diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2012-10-26 15:31:50 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2012-10-26 15:31:50 +0100 |
commit | 2ae42dd8a6abcdecbcfe53ef946774f2b4691821 (patch) | |
tree | cbf82412959719541dc296afb17dc195c5ce5d1a | |
parent | 567ea52b3b202c2fb8a78199a8ba986757735ec5 (diff) | |
download | rabbitmq-server-bug25236.tar.gz |
Yet another way in which add_mirror / drop_mirror "failing" can be OK really.bug25236
-rw-r--r-- | src/rabbit_amqqueue.erl | 3 | ||||
-rw-r--r-- | src/rabbit_mirror_queue_misc.erl | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index 6ad85b24..87e44aa3 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -18,7 +18,7 @@ -export([start/0, stop/0, declare/5, delete_immediately/1, delete/3, purge/1]). -export([pseudo_queue/2]). --export([lookup/1, with/2, with_or_die/2, assert_equivalence/5, +-export([lookup/1, with/2, with/3, with_or_die/2, assert_equivalence/5, check_exclusive_access/2, with_exclusive_access_or_die/3, stat/1, deliver/2, deliver_flow/2, requeue/3, ack/3, reject/4]). -export([list/0, list/1, info_keys/0, info/1, info/2, info_all/1, info_all/2]). @@ -81,6 +81,7 @@ rabbit_types:error('not_found'); ([name()]) -> [rabbit_types:amqqueue()]). -spec(with/2 :: (name(), qfun(A)) -> A | rabbit_types:error('not_found')). +-spec(with/3 :: (name(), qfun(A), fun(() -> B)) -> A | B). -spec(with_or_die/2 :: (name(), qfun(A)) -> A | rabbit_types:channel_exit()). -spec(assert_equivalence/5 :: diff --git a/src/rabbit_mirror_queue_misc.erl b/src/rabbit_mirror_queue_misc.erl index 8a363f76..80e49008 100644 --- a/src/rabbit_mirror_queue_misc.erl +++ b/src/rabbit_mirror_queue_misc.erl @@ -137,7 +137,7 @@ on_node_up() -> ok. drop_mirrors(QName, Nodes) -> - [ok = drop_mirror(QName, Node) || Node <- Nodes], + [{ok, _} = drop_mirror(QName, Node) || Node <- Nodes], ok. drop_mirror(QName, MirrorNode) -> @@ -154,7 +154,7 @@ drop_mirror(QName, MirrorNode) -> "Dropping queue mirror on node ~p for ~s~n", [MirrorNode, rabbit_misc:rs(Name)]), exit(Pid, {shutdown, dropped}), - ok + {ok, dropped} end end). @@ -212,7 +212,8 @@ if_mirrored_queue(QName, Fun) -> false -> ok; true -> Fun(Q) end - end). + end, + rabbit_misc:const({ok, not_found})). report_deaths(_MirrorPid, _IsMaster, _QueueName, []) -> ok; |