summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrancesco Mazzoli <francesco@rabbitmq.com>2012-02-29 13:38:01 +0000
committerFrancesco Mazzoli <francesco@rabbitmq.com>2012-02-29 13:38:01 +0000
commit7c30fae1881216f549ec9f9d2e1ea26603d489f7 (patch)
tree4772ed8e4820594e3d6866b684158fa919a43781 /src
parent1a2ea0daa42e5f8265626755679be81a571144cb (diff)
downloadrabbitmq-server-git-7c30fae1881216f549ec9f9d2e1ea26603d489f7.tar.gz
Assert in timeout, better sync comment, changed naming of needs_index_sync.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_queue_index.erl4
-rw-r--r--src/rabbit_variable_queue.erl8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/rabbit_queue_index.erl b/src/rabbit_queue_index.erl
index 1e55add215..89dfe055fc 100644
--- a/src/rabbit_queue_index.erl
+++ b/src/rabbit_queue_index.erl
@@ -283,8 +283,8 @@ deliver(SeqIds, State) ->
ack(SeqIds, State) ->
deliver_or_ack(ack, SeqIds, State).
-%% This is only called when there are outstanding confirms and the
-%% queue is idle.
+%% This is called when there are outstanding confirms or when the
+%% queue is idle and the journal needs syncing (see needs_sync/1).
sync(State = #qistate { journal_handle = undefined }) ->
State;
sync(State = #qistate { journal_handle = JournalHdl }) ->
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index 28b7830e7d..99c14f0554 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -732,7 +732,7 @@ ram_duration(State = #vqstate {
ram_ack_count_prev = RamAckCount }}.
needs_timeout(State = #vqstate { index_state = IndexState }) ->
- case needs_index_sync(State) of
+ case must_sync_index(State) of
true -> timed;
false ->
case rabbit_queue_index:needs_sync(IndexState) of
@@ -751,7 +751,7 @@ needs_timeout(State = #vqstate { index_state = IndexState }) ->
timeout(State = #vqstate { index_state = IndexState }) ->
IndexState1 = rabbit_queue_index:sync(IndexState),
State1 = State #vqstate { index_state = IndexState1 },
- reduce_memory_use(State1).
+ a(reduce_memory_use(State1)).
handle_pre_hibernate(State = #vqstate { index_state = IndexState }) ->
State #vqstate { index_state = rabbit_queue_index:flush(IndexState) }.
@@ -1277,8 +1277,8 @@ record_confirms(MsgIdSet, State = #vqstate { msgs_on_disk = MOD,
unconfirmed = gb_sets:difference(UC, MsgIdSet),
confirmed = gb_sets:union (C, MsgIdSet) }.
-needs_index_sync(#vqstate { msg_indices_on_disk = MIOD,
- unconfirmed = UC }) ->
+must_sync_index(#vqstate { msg_indices_on_disk = MIOD,
+ unconfirmed = UC }) ->
%% If UC is empty then by definition, MIOD and MOD are also empty
%% and there's nothing that can be pending a sync.