diff options
author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-02-09 14:37:49 +0000 |
---|---|---|
committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-02-09 14:37:49 +0000 |
commit | 9d20e58a79a57aca098f867d74f1910b5a012a41 (patch) | |
tree | 4f1a4f453646393b673b728288e9898b98959ec0 /src/rabbit_variable_queue.erl | |
parent | 00b78cccf0536a50b9e0f9e32bf68a62edbd52a1 (diff) | |
download | rabbitmq-server-9d20e58a79a57aca098f867d74f1910b5a012a41.tar.gz |
Syncing instead of flushing.
This stops needs_timeout and timeout from going in a loop. However, since
rabbit_queue_index:needs_sync works looking at unsynced_msg_ids, this doesn't
preserving acks when the broker is terminated abruptedly, since the timeout
won't be triggered (needs_sync will return false).
If needs_sync is defined inspecting the write_buffer if the file_handle_cache,
needs_timeout and timeout go in a loop, for reason that are not clear to me
now.
Diffstat (limited to 'src/rabbit_variable_queue.erl')
-rw-r--r-- | src/rabbit_variable_queue.erl | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index 6f1c3847..3e605f04 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -734,18 +734,14 @@ ram_duration(State = #vqstate { needs_timeout(State = #vqstate { index_state = IndexState }) -> case needs_index_sync(State) of true -> timed; - false -> case rabbit_queue_index:needs_flush(IndexState) of + false -> case rabbit_queue_index:needs_sync(IndexState) of true -> idle; false -> false end end. timeout(State = #vqstate { index_state = IndexState }) -> - IndexState1 = - case needs_index_sync(State) of - true -> rabbit_queue_index:sync(IndexState); - false -> rabbit_queue_index:flush(IndexState) - end, + IndexState1 = rabbit_queue_index:sync(IndexState), State1 = State #vqstate { index_state = IndexState1 }, a(case reduce_memory_use( fun (_Quota, State1) -> {0, State1} end, |