summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-05-17 11:14:36 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2011-05-17 11:14:36 +0100
commitf42f00c82076c3d2c756b0df1a1d74ec3eabe360 (patch)
tree294b455c6bdce58625fd33dd2189c91c9362abf0 /src
parent453ece9b11a0cef4b9ce6c300b12ed07cde1c931 (diff)
downloadrabbitmq-server-git-f42f00c82076c3d2c756b0df1a1d74ec3eabe360.tar.gz
Not especially happy with this but can't think of how else to solve this. If the queue has mirrors then you may well find that during death you try to contact a dead queue process, because the mnesia table is yet to be updated. In such cases, loop.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index d79fe9df39..534d1002b9 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -256,8 +256,13 @@ lookup(Name) ->
with(Name, F, E) ->
case lookup(Name) of
- {ok, Q} -> rabbit_misc:with_exit_handler(E, fun () -> F(Q) end);
- {error, not_found} -> E()
+ {ok, Q = #amqqueue{mirror_pids = []}} ->
+ rabbit_misc:with_exit_handler(E, fun () -> F(Q) end);
+ {ok, Q} ->
+ E1 = fun () -> with(Name, F, E) end,
+ rabbit_misc:with_exit_handler(E1, fun () -> F(Q) end);
+ {error, not_found} ->
+ E()
end.
with(Name, F) ->