summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-12-15 13:30:00 +0000
committerMatthew Sackman <matthew@lshift.net>2009-12-15 13:30:00 +0000
commitbe240e47b20c631e50b394a888e7eb785c278e36 (patch)
tree32524a65809fa256ce4998ecc55c55f425b9957a /src
parenta38cf00a8179ed38181756b178245724bd7d24a8 (diff)
downloadrabbitmq-server-git-be240e47b20c631e50b394a888e7eb785c278e36.tar.gz
Noticed that sometimes the shutdown message that appears to the queue process is of the form {shutdown,{gen_server2,call,[rabbit_msg_store,{read,<<96,94,147,36,83,202,129,231,131,151,203,11,95,112,69,118>>},infinity]}}. I presume this is when we're shutdown whilst in the middle of a call. In any case, it was falling through to the wrong case in queue process terminate, and resulting in the queue being deleted. Brilliant. Sadly, the fix is pretty much code duplication because you can't do a partial pattern match / unification in a guard.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue_process.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index 9cefa92694..d4d9611a43 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -124,6 +124,9 @@ init(Q = #amqqueue { name = QName }) ->
terminate(shutdown, #q{variable_queue_state = VQS}) ->
ok = rabbit_memory_monitor:deregister(self()),
_VQS = rabbit_variable_queue:terminate(VQS);
+terminate({shutdown, _}, #q{variable_queue_state = VQS}) ->
+ ok = rabbit_memory_monitor:deregister(self()),
+ _VQS = rabbit_variable_queue:terminate(VQS);
terminate(_Reason, State = #q{variable_queue_state = VQS}) ->
ok = rabbit_memory_monitor:deregister(self()),
%% FIXME: How do we cancel active subscriptions?