fix(emqx_connection): connection OOM kill immediately
Prior to this change, connection process' OOM kill is a loopback message, which results in a delayed kill when message queue length is large. In this change, the loopback message is changed to an exit signal.
This commit is contained in:
parent
2e30d7803f
commit
66693d6846
|
@ -684,9 +684,11 @@ check_oom(State = #state{channel = Channel}) ->
|
||||||
Zone = emqx_channel:info(zone, Channel),
|
Zone = emqx_channel:info(zone, Channel),
|
||||||
OomPolicy = emqx_zone:oom_policy(Zone),
|
OomPolicy = emqx_zone:oom_policy(Zone),
|
||||||
case ?ENABLED(OomPolicy) andalso emqx_misc:check_oom(OomPolicy) of
|
case ?ENABLED(OomPolicy) andalso emqx_misc:check_oom(OomPolicy) of
|
||||||
Shutdown = {shutdown, _Reason} ->
|
{shutdown, Reason} ->
|
||||||
erlang:send(self(), Shutdown);
|
%% triggers terminate/2 callback immediately
|
||||||
_Other -> ok
|
erlang:exit({shutdown, Reason});
|
||||||
|
_Other ->
|
||||||
|
ok
|
||||||
end,
|
end,
|
||||||
State.
|
State.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue