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),
|
||||
OomPolicy = emqx_zone:oom_policy(Zone),
|
||||
case ?ENABLED(OomPolicy) andalso emqx_misc:check_oom(OomPolicy) of
|
||||
Shutdown = {shutdown, _Reason} ->
|
||||
erlang:send(self(), Shutdown);
|
||||
_Other -> ok
|
||||
{shutdown, Reason} ->
|
||||
%% triggers terminate/2 callback immediately
|
||||
erlang:exit({shutdown, Reason});
|
||||
_Other ->
|
||||
ok
|
||||
end,
|
||||
State.
|
||||
|
||||
|
|
Loading…
Reference in New Issue