diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2011-05-17 11:14:36 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-05-17 11:14:36 +0100 |
| commit | f42f00c82076c3d2c756b0df1a1d74ec3eabe360 (patch) | |
| tree | 294b455c6bdce58625fd33dd2189c91c9362abf0 /src | |
| parent | 453ece9b11a0cef4b9ce6c300b12ed07cde1c931 (diff) | |
| download | rabbitmq-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.erl | 9 |
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) -> |
