summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-12-20 04:10:45 +0000
committerMatthew Sackman <matthew@lshift.net>2009-12-20 04:10:45 +0000
commitce04e209a546f85e1630cf358c8ef37b3d238a61 (patch)
tree9395d07966a22eaccff3d1868d8d3255d5c506df
parent0599f5e85ec9149109561b3954818c5db7a2d25b (diff)
downloadrabbitmq-server-git-ce04e209a546f85e1630cf358c8ef37b3d238a61.tar.gz
Must start msg_store *before* amqqueue_sup, otherwise on shutdown, there's a nasty race which blows up the channel on notify_all_down because the msg_store exits wrongly, first, killing the queue process when it calls msg_store:read, and then the channel can't call the queue. Thus start msg_store before queue_sup, and none of this problem exists
-rw-r--r--src/rabbit.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl
index 2aa58fc02a..fe1be7c292 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -150,12 +150,11 @@ start(normal, []) ->
start_child(vm_memory_monitor, [MemoryWatermark])
end,
- ok = rabbit_amqqueue:start(),
+ ok = start_child(rabbit_memory_monitor),
+ ok = start_child(rabbit_guid),
ok = start_child(rabbit_router),
- ok = start_child(rabbit_guid),
- ok = start_child(rabbit_node_monitor),
- ok = start_child(rabbit_memory_monitor)
+ ok = start_child(rabbit_node_monitor)
end},
{"recovery",
fun () ->
@@ -163,6 +162,9 @@ start(normal, []) ->
ok = rabbit_exchange:recover(),
DurableQueues = rabbit_amqqueue:find_durable_queues(),
ok = rabbit_queue_index:start_msg_store(DurableQueues),
+
+ ok = rabbit_amqqueue:start(),
+
{ok, _RealDurableQueues} = rabbit_amqqueue:recover(DurableQueues)
%% TODO - RealDurableQueues is a subset of
%% DurableQueues. It may have queues removed which