Skip to content

Commit 5f03dcc

Browse files
dumbbellgerhard
authored andcommitted
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 <[email protected]>
1 parent 46eb2e5 commit 5f03dcc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/gm.erl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,7 @@ init([GroupName, Module, Args, TxnFun]) ->
552552
broadcast_buffer_sz = 0,
553553
broadcast_timer = undefined,
554554
txn_executor = TxnFun,
555-
shutting_down = false }, hibernate,
556-
{backoff, ?HIBERNATE_AFTER_MIN, ?HIBERNATE_AFTER_MIN, ?DESIRED_HIBERNATE}}.
555+
shutting_down = false }}.
557556

558557

559558
handle_call({confirmed_broadcast, _Msg}, _From,
@@ -888,7 +887,7 @@ noreply(State) ->
888887
reply(Reply, State) ->
889888
{reply, Reply, ensure_broadcast_timer(State), flush_timeout(State)}.
890889

891-
flush_timeout(#state{broadcast_buffer = []}) -> hibernate;
890+
flush_timeout(#state{broadcast_buffer = []}) -> infinity;
892891
flush_timeout(_) -> 0.
893892

894893
ensure_broadcast_timer(State = #state { broadcast_buffer = [],

0 commit comments

Comments
 (0)