Remove hibernate from GM

We don't want to use the backoff/hibernate feature because we have
observed that the GM process is suspended half of the time.

We really wanted to replace gen_server2 with gen_server, but it was more
important to keep changes in 3.6 to a minimum. GM will eventually be
replaced, so switching it from gen_server2 to gen_server will be soon
redundant. We simply do not understand some of the gen_server2
trade-offs well enough to feel strongly about this change.

[#148892851]

Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com>
This commit is contained in:
Jean-Sébastien Pédron 2017-07-18 17:21:00 +02:00 committed by Gerhard Lazu
parent 46eb2e5403
commit 5f03dcc56c
1 changed files with 2 additions and 3 deletions

View File

@ -552,8 +552,7 @@ init([GroupName, Module, Args, TxnFun]) ->
broadcast_buffer_sz = 0,
broadcast_timer = undefined,
txn_executor = TxnFun,
shutting_down = false }, hibernate,
{backoff, ?HIBERNATE_AFTER_MIN, ?HIBERNATE_AFTER_MIN, ?DESIRED_HIBERNATE}}.
shutting_down = false }}.
handle_call({confirmed_broadcast, _Msg}, _From,
@ -888,7 +887,7 @@ noreply(State) ->
reply(Reply, State) ->
{reply, Reply, ensure_broadcast_timer(State), flush_timeout(State)}.
flush_timeout(#state{broadcast_buffer = []}) -> hibernate;
flush_timeout(#state{broadcast_buffer = []}) -> infinity;
flush_timeout(_) -> 0.
ensure_broadcast_timer(State = #state { broadcast_buffer = [],