summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-09-23 16:34:47 +0100
committerSimon MacMullen <simon@rabbitmq.com>2013-09-23 16:34:47 +0100
commit13bbe2eab8cce64d38efbfb9171bc9a55141f866 (patch)
treecf5fc1e9eb456883d41b0f86b580924aa532d275
parente6b81396e4c6deed2c2fc59f056544dabae77a09 (diff)
downloadrabbitmq-server-git-13bbe2eab8cce64d38efbfb9171bc9a55141f866.tar.gz
Slightly better comments.
-rw-r--r--src/rabbit_memory_monitor.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rabbit_memory_monitor.erl b/src/rabbit_memory_monitor.erl
index 2e9a820cb2..4f8202cdad 100644
--- a/src/rabbit_memory_monitor.erl
+++ b/src/rabbit_memory_monitor.erl
@@ -236,10 +236,10 @@ desired_duration_average(#state{queue_duration_sum = Sum,
(Sum / Count) / MemoryRatio
end.
+%% In normal use, we only inform queues immediately if the desired
+%% duration has decreased, we want to ensure timely paging.
maybe_inform_queues(false, DesiredDurationAvg, DesiredDurationAvg1,
Durations) ->
- %% only inform queues immediately if the desired duration has
- %% decreased
case DesiredDurationAvg1 == infinity orelse
(DesiredDurationAvg /= infinity andalso
DesiredDurationAvg1 >= DesiredDurationAvg) of
@@ -247,6 +247,9 @@ maybe_inform_queues(false, DesiredDurationAvg, DesiredDurationAvg1,
false -> inform_queues(DesiredDurationAvg1, Durations,
fun should_send/3)
end;
+%% When the disk alarm has gone off though, we want to inform queues
+%% immediately if the desired duration has *increased* - we want to
+%% ensure timely stopping paging.
maybe_inform_queues(true, DesiredDurationAvg, DesiredDurationAvg1,
Durations) ->
case DesiredDurationAvg1 == infinity andalso