diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2012-07-12 16:55:52 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2012-07-12 16:55:52 +0100 |
commit | ccd409f9522378fed49bf9a56c474734e8a85b7d (patch) | |
tree | 40706b0ddfdb429179cafd410eaea9e9decc5666 | |
parent | a47b7dba6201972a293dd3563466ad29f834e799 (diff) | |
download | rabbitmq-server-bug25053.tar.gz |
When handling emit_stats we should do nearly everything we normally do in noreply/1, just not create another stats timer.bug25053
-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 8933de87..b42d1aea 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -1328,11 +1328,11 @@ handle_info(drop_expired, State) -> noreply(drop_expired_messages(State#q{ttl_timer_ref = undefined})); handle_info(emit_stats, State) -> - %% Do not invoke noreply as it would see no timer and create a new one. emit_stats(State), - State1 = rabbit_event:reset_stats_timer(State, #q.stats_timer), - assert_invariant(State1), - {noreply, State1, hibernate}; + {noreply, State1, Timeout} = noreply(State), + %% Need to reset *after* we've been through noreply/1 so we do not + %% just create another timer always and therefore never hibernate + {noreply, rabbit_event:reset_stats_timer(State1, #q.stats_timer), Timeout}; handle_info({'DOWN', _MonitorRef, process, DownPid, _Reason}, State = #q{q = #amqqueue{exclusive_owner = DownPid}}) -> |