Optimize GC (#2917)

This commit is contained in:
turtleDeng 2019-09-20 16:55:12 +08:00 committed by Shawn
parent 2d99a1412e
commit 9c2584607a
2 changed files with 5 additions and 2 deletions

View File

@ -352,7 +352,7 @@ handle(info, {timeout, Timer, emit_stats},
{keep_state, NState#state{gc_state = GcState1}, hibernate};
{shutdown, Reason} ->
?LOG(error, "Shutdown exceptionally due to ~p", [Reason]),
shutdown(Reason, NState)
self() ! {shutdown, Reason}
end;
handle(info, {shutdown, discard, {ClientId, ByPid}}, State) ->

View File

@ -603,7 +603,7 @@ handle_info({timeout, Timer, emit_stats},
{noreply, NewState#state{gc_state = GcState1}, hibernate};
{shutdown, Reason} ->
?LOG(warning, "Shutdown exceptionally due to ~p", [Reason]),
shutdown(Reason, NewState)
self() ! {shutdown, Reason}
end;
handle_info({timeout, Timer, expired}, State = #state{expiry_timer = Timer}) ->
@ -646,6 +646,9 @@ handle_info({'EXIT', Pid, Reason}, State = #state{conn_pid = ConnPid}) ->
[ConnPid, Pid, Reason]),
{noreply, State};
handle_info({shutdown, Reason}, State) ->
shutdown(Reason, State);
handle_info(Info, State) ->
?LOG(error, "Unexpected info: ~p", [Info]),
{noreply, State}.