summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-06-14 17:59:02 +0100
committerSimon MacMullen <simon@rabbitmq.com>2012-06-14 17:59:02 +0100
commite30874df1b9b05b0948bc2cb6785a8003d353661 (patch)
tree339369cb7aab4dc9978186209f61be185f73bded
parente4d5120b05cfb31070ffff8e932656290e702ba6 (diff)
downloadrabbitmq-server-e30874df1b9b05b0948bc2cb6785a8003d353661.tar.gz
Backport 4a224e961141 (Merge of bug24939; delays in handling node down causes errors on transient queue operations)
-rw-r--r--src/rabbit_amqqueue.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index c1673504..eca1017c 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -166,6 +166,9 @@
[queue_name, channel_pid, consumer_tag, ack_required]).
start() ->
+ %% Clear out remnants of old incarnation, in case we restarted
+ %% faster than other nodes handled DOWN messages from us.
+ on_node_down(node()),
DurableQueues = find_durable_queues(),
{ok, BQ} = application:get_env(rabbit, backing_queue_module),
ok = BQ:start([QName || #amqqueue{name = QName} <- DurableQueues]),
@@ -573,7 +576,8 @@ on_node_down(Node) ->
#amqqueue{name = QName, pid = Pid,
slave_pids = []}
<- mnesia:table(rabbit_queue),
- node(Pid) == Node])),
+ node(Pid) == Node andalso
+ not is_process_alive(Pid)])),
{Qs, Dels} = lists:unzip(QsDels),
T = rabbit_binding:process_deletions(
lists:foldl(fun rabbit_binding:combine_deletions/2,