summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-05-19 13:32:09 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2011-05-19 13:32:09 +0100
commit2d318b334722df94ef5b18811c37200e724ea63c (patch)
treeb2f386877fc380e70f10fc16a6e6159e11a7119c
parente73056d450d37065004deb1e7a0eaca1b0973ad1 (diff)
downloadrabbitmq-server-bug24117.tar.gz
BQ:idle_timeout => BQ:timeoutbug24117
-rw-r--r--include/rabbit_backing_queue_spec.hrl2
-rw-r--r--src/rabbit_amqqueue_process.erl8
-rw-r--r--src/rabbit_backing_queue.erl4
-rw-r--r--src/rabbit_tests.erl4
-rw-r--r--src/rabbit_variable_queue.erl6
5 files changed, 12 insertions, 12 deletions
diff --git a/include/rabbit_backing_queue_spec.hrl b/include/rabbit_backing_queue_spec.hrl
index f43baf0d..1c2b94e2 100644
--- a/include/rabbit_backing_queue_spec.hrl
+++ b/include/rabbit_backing_queue_spec.hrl
@@ -67,7 +67,7 @@
(('undefined' | 'infinity' | number()), state()) -> state()).
-spec(ram_duration/1 :: (state()) -> {number(), state()}).
-spec(needs_timeout/1 :: (state()) -> 'false' | 'timed' | 'idle').
--spec(idle_timeout/1 :: (state()) -> state()).
+-spec(timeout/1 :: (state()) -> state()).
-spec(handle_pre_hibernate/1 :: (state()) -> state()).
-spec(status/1 :: (state()) -> [{atom(), any()}]).
-spec(invoke/3 :: (atom(), fun ((atom(), A) -> A), state()) -> state()).
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index 6a9e6575..8091e2c2 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -662,8 +662,8 @@ maybe_send_reply(ChPid, Msg) -> ok = rabbit_channel:send_command(ChPid, Msg).
qname(#q{q = #amqqueue{name = QName}}) -> QName.
-backing_queue_idle_timeout(State = #q{backing_queue = BQ}) ->
- run_backing_queue(BQ, fun (M, BQS) -> M:idle_timeout(BQS) end, State).
+backing_queue_timeout(State = #q{backing_queue = BQ}) ->
+ run_backing_queue(BQ, fun (M, BQS) -> M:timeout(BQS) end, State).
run_backing_queue(Mod, Fun, State = #q{backing_queue = BQ,
backing_queue_state = BQS}) ->
@@ -1047,7 +1047,7 @@ handle_cast({run_backing_queue, Mod, Fun}, State) ->
noreply(run_backing_queue(Mod, Fun, State));
handle_cast(sync_timeout, State) ->
- noreply(backing_queue_idle_timeout(State#q{sync_timer_ref = undefined}));
+ noreply(backing_queue_timeout(State#q{sync_timer_ref = undefined}));
handle_cast({deliver, Delivery}, State) ->
%% Asynchronous, non-"mandatory", non-"immediate" deliver mode.
@@ -1181,7 +1181,7 @@ handle_info({'DOWN', _MonitorRef, process, DownPid, _Reason}, State) ->
end;
handle_info(timeout, State) ->
- noreply(backing_queue_idle_timeout(State));
+ noreply(backing_queue_timeout(State));
handle_info({'EXIT', _Pid, Reason}, State) ->
{stop, Reason, State};
diff --git a/src/rabbit_backing_queue.erl b/src/rabbit_backing_queue.erl
index 293b5655..addaabc5 100644
--- a/src/rabbit_backing_queue.erl
+++ b/src/rabbit_backing_queue.erl
@@ -149,7 +149,7 @@ behaviour_info(callbacks) ->
%% queue.
{ram_duration, 1},
- %% Should 'idle_timeout' be called as soon as the queue process
+ %% Should 'timeout' be called as soon as the queue process
%% can manage (either on an empty mailbox, or when a timer
%% fires)?
{needs_timeout, 1},
@@ -157,7 +157,7 @@ behaviour_info(callbacks) ->
%% Called (eventually) after needs_timeout returns 'idle' or
%% 'timed'. Note this may be called more than once for each
%% 'idle' or 'timed' returned from needs_timeout.
- {idle_timeout, 1},
+ {timeout, 1},
%% Called immediately before the queue hibernates.
{handle_pre_hibernate, 1},
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl
index 5137cce1..1a37cdff 100644
--- a/src/rabbit_tests.erl
+++ b/src/rabbit_tests.erl
@@ -2272,7 +2272,7 @@ variable_queue_wait_for_shuffling_end(VQ) ->
case rabbit_variable_queue:needs_timeout(VQ) of
false -> VQ;
_ -> variable_queue_wait_for_shuffling_end(
- rabbit_variable_queue:idle_timeout(VQ))
+ rabbit_variable_queue:timeout(VQ))
end.
test_variable_queue_all_the_bits_not_covered_elsewhere1(VQ0) ->
@@ -2300,7 +2300,7 @@ test_variable_queue_all_the_bits_not_covered_elsewhere2(VQ0) ->
{VQ3, AckTags} = variable_queue_fetch(2, false, false, 4, VQ2),
{_Guids, VQ4} =
rabbit_variable_queue:requeue(AckTags, fun(X) -> X end, VQ3),
- VQ5 = rabbit_variable_queue:idle_timeout(VQ4),
+ VQ5 = rabbit_variable_queue:timeout(VQ4),
_VQ6 = rabbit_variable_queue:terminate(VQ5),
VQ7 = variable_queue_init(test_amqqueue(true), true),
{empty, VQ8} = rabbit_variable_queue:fetch(false, VQ7),
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index 01f69712..3361e552 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -21,7 +21,7 @@
fetch/2, ack/2, tx_publish/5, tx_ack/3, tx_rollback/2, tx_commit/4,
requeue/3, len/1, is_empty/1, dropwhile/2,
set_ram_duration_target/2, ram_duration/1,
- needs_timeout/1, idle_timeout/1, handle_pre_hibernate/1,
+ needs_timeout/1, timeout/1, handle_pre_hibernate/1,
status/1, invoke/3, is_duplicate/3, discard/3,
multiple_routing_keys/0]).
@@ -146,7 +146,7 @@
%% any one time. This further smooths the effects of changes to the
%% target_ram_count and ensures the queue remains responsive
%% even when there is a large amount of IO work to do. The
-%% idle_timeout callback is utilised to ensure that conversions are
+%% timeout callback is utilised to ensure that conversions are
%% done as promptly as possible whilst ensuring the queue remains
%% responsive.
%%
@@ -845,7 +845,7 @@ needs_timeout(State = #vqstate { on_sync = OnSync }) ->
timed
end.
-idle_timeout(State) ->
+timeout(State) ->
a(reduce_memory_use(confirm_commit_index(tx_commit_index(State)))).
handle_pre_hibernate(State = #vqstate { index_state = IndexState }) ->