summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-10-05 16:29:17 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2010-10-05 16:29:17 +0100
commit37f21f92299df57edf05c8c2291538cc69e07ec9 (patch)
treed2a24537ecf298bd6db8bef083a66125fa647769
parentb11e17b0f19a5d63f968d577a101d58af9ea103e (diff)
parenta5e48b84c9f507f534c69eb8fabacafea9de0360 (diff)
downloadrabbitmq-server-37f21f92299df57edf05c8c2291538cc69e07ec9.tar.gz
Merging bug 23156 onto default
-rw-r--r--src/rabbit_amqqueue_process.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index 2c53a8e3..61204deb 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -251,8 +251,9 @@ stop_expiry_timer(State = #q{expiry_timer_ref = TRef}) ->
{ok, cancel} = timer:cancel(TRef),
State#q{expiry_timer_ref = undefined}.
-%% We only wish to expire where there are no consumers *and* when
-%% basic.get hasn't been called for the configured period.
+%% We wish to expire only when there are no consumers *and* the expiry
+%% hasn't been refreshed (by queue.declare or basic.get) for the
+%% configured period.
ensure_expiry_timer(State = #q{expires = undefined}) ->
State;
ensure_expiry_timer(State = #q{expires = Expires}) ->
@@ -783,7 +784,8 @@ handle_call({basic_cancel, ChPid, ConsumerTag, OkMsg}, _From,
handle_call(stat, _From, State = #q{backing_queue = BQ,
backing_queue_state = BQS,
active_consumers = ActiveConsumers}) ->
- reply({ok, BQ:len(BQS), queue:len(ActiveConsumers)}, State);
+ reply({ok, BQ:len(BQS), queue:len(ActiveConsumers)},
+ ensure_expiry_timer(State));
handle_call(delete_exclusive, _From,
State = #q{ backing_queue_state = BQS,