fix(emqx): rename wont_clear_alarm_in to min_alarm_sustain_duration
This commit is contained in:
parent
df0e905754
commit
f902d880c1
|
@ -894,11 +894,11 @@ zone.external.enable_flapping_detect = off
|
||||||
|
|
||||||
## Won't clear the congested alarm in how long time.
|
## Won't clear the congested alarm in how long time.
|
||||||
## The alarm is cleared only when there're no pending bytes in the queue, and also it has been
|
## The alarm is cleared only when there're no pending bytes in the queue, and also it has been
|
||||||
## `wont_clear_alarm_in` time since the last time we considered the connection is "congested".
|
## `min_alarm_sustain_duration` time since the last time we considered the connection is "congested".
|
||||||
##
|
##
|
||||||
## This is to avoid clearing and sending the alarm again too often.
|
## This is to avoid clearing and sending the alarm again too often.
|
||||||
## Default: 1m
|
## Default: 1m
|
||||||
#zone.external.conn_congestion.wont_clear_alarm_in = 1m
|
#zone.external.conn_congestion.min_alarm_sustain_duration = 1m
|
||||||
|
|
||||||
## Messages quota for the each of external MQTT connection.
|
## Messages quota for the each of external MQTT connection.
|
||||||
## This value consumed by the number of recipient on a message.
|
## This value consumed by the number of recipient on a message.
|
||||||
|
|
|
@ -1020,7 +1020,7 @@ end}.
|
||||||
{default, off}
|
{default, off}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{mapping, "zone.$name.conn_congestion.wont_clear_alarm_in", "emqx.zones", [
|
{mapping, "zone.$name.conn_congestion.min_alarm_sustain_duration", "emqx.zones", [
|
||||||
{default, "1m"},
|
{default, "1m"},
|
||||||
{datatype, {duration, ms}}
|
{datatype, {duration, ms}}
|
||||||
]}.
|
]}.
|
||||||
|
@ -1156,8 +1156,8 @@ end}.
|
||||||
{ratelimit, {conn_bytes_in, Ratelimit(Val)}};
|
{ratelimit, {conn_bytes_in, Ratelimit(Val)}};
|
||||||
(["conn_congestion", "alarm"], Val) ->
|
(["conn_congestion", "alarm"], Val) ->
|
||||||
{conn_congestion_alarm_enabled, Val};
|
{conn_congestion_alarm_enabled, Val};
|
||||||
(["conn_congestion", "wont_clear_alarm_in"], Val) ->
|
(["conn_congestion", "min_alarm_sustain_duration"], Val) ->
|
||||||
{conn_congestion_wont_clear_alarm_in, Val};
|
{conn_congestion_min_alarm_sustain_duration, Val};
|
||||||
(["quota", "conn_messages_routing"], Val) ->
|
(["quota", "conn_messages_routing"], Val) ->
|
||||||
{quota, {conn_messages_routing, Ratelimit(Val)}};
|
{quota, {conn_messages_routing, Ratelimit(Val)}};
|
||||||
(["quota", "overall_messages_routing"], Val) ->
|
(["quota", "overall_messages_routing"], Val) ->
|
||||||
|
|
|
@ -65,7 +65,8 @@ alarm_congestion(Socket, Transport, Channel, Reason) ->
|
||||||
|
|
||||||
cancel_alarm_congestion(Socket, Transport, Channel, Reason) ->
|
cancel_alarm_congestion(Socket, Transport, Channel, Reason) ->
|
||||||
Zone = emqx_channel:info(zone, Channel),
|
Zone = emqx_channel:info(zone, Channel),
|
||||||
WontClearIn = emqx_zone:get_env(Zone, conn_congestion_wont_clear_alarm_in, ?WONT_CLEAR_IN),
|
WontClearIn = emqx_zone:get_env(Zone, conn_congestion_min_alarm_sustain_duration,
|
||||||
|
?WONT_CLEAR_IN),
|
||||||
case has_alarm_sent(Reason) andalso long_time_since_last_alarm(Reason, WontClearIn) of
|
case has_alarm_sent(Reason) andalso long_time_since_last_alarm(Reason, WontClearIn) of
|
||||||
true -> do_cancel_alarm_congestion(Socket, Transport, Channel, Reason);
|
true -> do_cancel_alarm_congestion(Socket, Transport, Channel, Reason);
|
||||||
false -> ok
|
false -> ok
|
||||||
|
|
Loading…
Reference in New Issue