summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-11-12 11:57:55 +0000
committerMatthew Sackman <matthew@lshift.net>2009-11-12 11:57:55 +0000
commit72f90d15deb6e60f34ff6771fa7f3c70398f0a5d (patch)
tree64404f170df5fdb9fc9d3f17b1dd28b7cf7da220
parent0654c41ab845f43e4dfdcac4da274451d5829def (diff)
downloadrabbitmq-server-git-72f90d15deb6e60f34ff6771fa7f3c70398f0a5d.tar.gz
Firstly the desired queue length shouldn't go negative. Secondly, testing shows that the amqqueue_process should not flush the qi journal when idle. Doing so can lead to disk thrashing.
-rw-r--r--src/rabbit_amqqueue_process.erl17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index f247c0d1d4..a79abe8cdb 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -161,14 +161,10 @@ next_state1(State = #q{sync_timer_ref = undefined}, true) ->
{start_sync_timer(State), 0};
next_state1(State, true) ->
{State, 0};
-next_state1(State = #q{sync_timer_ref = undefined,
- variable_queue_state = VQS}, false) ->
- {State, case rabbit_variable_queue:can_flush_journal(VQS) of
- true -> 0;
- false -> hibernate
- end};
+next_state1(State = #q{sync_timer_ref = undefined}, false) ->
+ {State, hibernate};
next_state1(State, false) ->
- {stop_sync_timer(State), 0}.
+ {stop_sync_timer(State), hibernate}.
ensure_egress_rate_timer(State = #q{egress_rate_timer_ref = undefined}) ->
{ok, TRef} = timer:apply_after(?EGRESS_REMEASURE_INTERVAL, rabbit_amqqueue,
@@ -915,13 +911,6 @@ handle_info({'EXIT', _DownPid, normal}, State) ->
%% though, provided 'normal'
noreply(State);
-handle_info(timeout, State = #q{variable_queue_state = VQS,
- sync_timer_ref = undefined}) ->
- %% if sync_timer_ref is undefined then we must have set the
- %% timeout to zero because we thought we could flush the journal
- noreply(State#q{variable_queue_state =
- rabbit_variable_queue:flush_journal(VQS)});
-
handle_info(timeout, State = #q{variable_queue_state = VQS}) ->
noreply(
run_message_queue(