diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2011-01-25 15:22:56 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-01-25 15:22:56 +0000 |
commit | 49d6abb4bc943b92e826d7d9db709bd056674017 (patch) | |
tree | 57ec9b97df59916ce882aa8ff193fd8a1b5be78c /src/rabbit_amqqueue_process.erl | |
parent | a96cfec75431e3574a45ec2eb98ada0b08d01834 (diff) | |
download | rabbitmq-server-49d6abb4bc943b92e826d7d9db709bd056674017.tar.gz |
On pre_hibernate, report the real ram duration, not infinity. The assumption that pre_hibernation implies hibernation that will last for long enough for the ram duration to go to inifinity is not correct.bug23740
Diffstat (limited to 'src/rabbit_amqqueue_process.erl')
-rw-r--r-- | src/rabbit_amqqueue_process.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 0346ec7d..3418c663 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -1149,15 +1149,15 @@ handle_pre_hibernate(State = #q{backing_queue_state = undefined}) -> handle_pre_hibernate(State = #q{backing_queue = BQ, backing_queue_state = BQS, stats_timer = StatsTimer}) -> - BQS1 = BQ:handle_pre_hibernate(BQS), - %% no activity for a while == 0 egress and ingress rates + {RamDuration, BQS1} = BQ:ram_duration(BQS), DesiredDuration = - rabbit_memory_monitor:report_ram_duration(self(), infinity), + rabbit_memory_monitor:report_ram_duration(self(), RamDuration), BQS2 = BQ:set_ram_duration_target(DesiredDuration, BQS1), + BQS3 = BQ:handle_pre_hibernate(BQS2), rabbit_event:if_enabled(StatsTimer, fun () -> emit_stats(State, [{idle_since, now()}]) end), State1 = State#q{stats_timer = rabbit_event:stop_stats_timer(StatsTimer), - backing_queue_state = BQS2}, + backing_queue_state = BQS3}, {hibernate, stop_rate_timer(State1)}. |