fix(emqx): check if the congestion alarm was sent before clearing (#4824)
This commit is contained in:
parent
84293da42f
commit
97e27faf05
|
@ -2,10 +2,12 @@
|
|||
{VSN,
|
||||
[
|
||||
{"4.3.1", [
|
||||
{load_module, emqx_congestion, brutal_purge, soft_purge, []},
|
||||
{load_module, emqx_node_dump, brutal_purge, soft_purge, []}
|
||||
]},
|
||||
{"4.3.0", [
|
||||
{load_module, emqx_logger_jsonfmt, brutal_purge, soft_purge, []},
|
||||
{load_module, emqx_congestion, brutal_purge, soft_purge, []},
|
||||
{load_module, emqx_connection, brutal_purge, soft_purge, []},
|
||||
{load_module, emqx_frame, brutal_purge, soft_purge, []},
|
||||
{load_module, emqx_trie, brutal_purge, soft_purge, []},
|
||||
|
@ -16,11 +18,13 @@
|
|||
],
|
||||
[
|
||||
{"4.3.1", [
|
||||
{load_module, emqx_congestion, brutal_purge, soft_purge, []},
|
||||
{load_module, emqx_node_dump, brutal_purge, soft_purge, []}
|
||||
]},
|
||||
{"4.3.0", [
|
||||
{load_module, emqx_logger_jsonfmt, brutal_purge, soft_purge, []},
|
||||
{load_module, emqx_connection, brutal_purge, soft_purge, []},
|
||||
{load_module, emqx_congestion, brutal_purge, soft_purge, []},
|
||||
{load_module, emqx_frame, brutal_purge, soft_purge, []},
|
||||
{load_module, emqx_trie, brutal_purge, soft_purge, []},
|
||||
%% Just load the module. We don't need to change the 'messages.retained'
|
||||
|
|
|
@ -48,7 +48,10 @@ maybe_alarm_conn_congestion(Socket, Transport, Channel) ->
|
|||
|
||||
cancel_alarms(Socket, Transport, Channel) ->
|
||||
lists:foreach(fun(Reason) ->
|
||||
do_cancel_alarm_congestion(Socket, Transport, Channel, Reason)
|
||||
case has_alarm_sent(Reason) of
|
||||
true -> do_cancel_alarm_congestion(Socket, Transport, Channel, Reason);
|
||||
false -> ok
|
||||
end
|
||||
end, ?ALL_ALARM_REASONS).
|
||||
|
||||
is_alarm_enabled(Channel) ->
|
||||
|
|
Loading…
Reference in New Issue