summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-04-13 15:27:29 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2011-04-13 15:27:29 +0100
commit2acabcea54950f2bed84f1faae59984d51fb52bd (patch)
treeda037a99887a3eb806c98dc02d6217280288dd06 /src
parent2f9dbde73fc57c2e35308fefd6fff56c73a46fb6 (diff)
downloadrabbitmq-server-git-2acabcea54950f2bed84f1faae59984d51fb52bd.tar.gz
Forgot to undo these bits, and the boot sequence has been changed, so debitrot
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue_process.erl8
-rw-r--r--src/rabbit_mirror_queue_slave.erl8
-rw-r--r--src/rabbit_mirror_queue_slave_sup.erl2
3 files changed, 13 insertions, 5 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index 53bdd3b296..a8b19b72de 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -1234,11 +1234,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 = rabbit_amqqueue_process_utils:backing_queue_pre_hibernate(BQ, BQS),
+ {RamDuration, BQS1} = BQ:ram_duration(BQS),
+ DesiredDuration =
+ 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 = BQS1},
+ backing_queue_state = BQS3},
{hibernate, stop_rate_timer(State1)}.
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index e3cfe54dcc..cceb67e29c 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -235,8 +235,12 @@ code_change(_OldVsn, State, _Extra) ->
handle_pre_hibernate(State = #state { backing_queue = BQ,
backing_queue_state = BQS }) ->
- BQS1 = rabbit_amqqueue_process_utils:backing_queue_pre_hibernate(BQ, BQS),
- {hibernate, stop_rate_timer(State #state { backing_queue_state = BQS1 })}.
+ {RamDuration, BQS1} = BQ:ram_duration(BQS),
+ DesiredDuration =
+ rabbit_memory_monitor:report_ram_duration(self(), RamDuration),
+ BQS2 = BQ:set_ram_duration_target(DesiredDuration, BQS1),
+ BQS3 = BQ:handle_pre_hibernate(BQS2),
+ {hibernate, stop_rate_timer(State #state { backing_queue_state = BQS3 })}.
prioritise_call(Msg, _From, _State) ->
case Msg of
diff --git a/src/rabbit_mirror_queue_slave_sup.erl b/src/rabbit_mirror_queue_slave_sup.erl
index 2fb3be5196..25ee1fd0a7 100644
--- a/src/rabbit_mirror_queue_slave_sup.erl
+++ b/src/rabbit_mirror_queue_slave_sup.erl
@@ -19,7 +19,7 @@
-rabbit_boot_step({mirror_queue_slave_sup,
[{description, "mirror queue slave sup"},
{mfa, {rabbit_mirror_queue_slave_sup, start, []}},
- {requires, queue_sup_queue_recovery},
+ {requires, recovery},
{enables, routing_ready}]}).
-rabbit_boot_step({mirrored_queues,