summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Harrop <rob@rabbitmq.com>2011-06-13 10:46:01 +0100
committerRob Harrop <rob@rabbitmq.com>2011-06-13 10:46:01 +0100
commit76552918fd0e8636eee8087204e1a169f3a9c66e (patch)
tree4cad6977ba520cb61b4709eeae961845e7a7a250
parent44d75673aa6c6c8c429072124bf4e391b9c93bd7 (diff)
downloadrabbitmq-server-git-76552918fd0e8636eee8087204e1a169f3a9c66e.tar.gz
Bit of a hack, but it gets the tests passing for now
-rw-r--r--src/rabbit_amqqueue_process.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index 1c3277d6e4..8f6cea3cf0 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -121,7 +121,11 @@ terminate(shutdown = R, State = #q{backing_queue = BQ}) ->
terminate({shutdown, _} = R, State = #q{backing_queue = BQ}) ->
terminate_shutdown(fun (BQS) -> BQ:terminate(R, BQS) end, State);
terminate(Reason, State = #q{backing_queue = BQ}) ->
- State1 = maybe_dead_letter_queue(queue_deleted, State),
+ DeathReason = case get(death_reason) of
+ undefined -> queue_deleted;
+ DR -> DR
+ end,
+ State1 = maybe_dead_letter_queue(DeathReason, State),
%% FIXME: How do we cancel active subscriptions?
terminate_shutdown(fun (BQS) ->
@@ -1232,6 +1236,7 @@ handle_cast({set_maximum_since_use, Age}, State) ->
handle_cast(maybe_expire, State) ->
case is_unused(State) of
true -> ?LOGDEBUG("Queue lease expired for ~p~n", [State#q.q]),
+ put(death_reason, queue_expired),
{stop, normal, State};
false -> noreply(ensure_expiry_timer(State))
end;