Merge pull request #10623 from zhongwencool/rename-max-message-queue-len

feat: rename max_message_queue_len to max_mailbox_size
This commit is contained in:
zhongwencool 2023-05-08 23:08:06 +08:00 committed by GitHub
commit f6c5644448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 18 additions and 16 deletions

View File

@ -687,12 +687,13 @@ fields("force_shutdown") ->
desc => ?DESC(force_shutdown_enable) desc => ?DESC(force_shutdown_enable)
} }
)}, )},
{"max_message_queue_len", {"max_mailbox_size",
sc( sc(
range(0, inf), range(0, inf),
#{ #{
default => 1000, default => 1000,
desc => ?DESC(force_shutdown_max_message_queue_len) aliases => [max_message_queue_len],
desc => ?DESC(force_shutdown_max_mailbox_size)
} }
)}, )},
{"max_heap_size", {"max_heap_size",

View File

@ -238,7 +238,7 @@
-type stats() :: [{atom(), term()}]. -type stats() :: [{atom(), term()}].
-type oom_policy() :: #{ -type oom_policy() :: #{
max_message_queue_len => non_neg_integer(), max_mailbox_size => non_neg_integer(),
max_heap_size => non_neg_integer(), max_heap_size => non_neg_integer(),
enable => boolean() enable => boolean()
}. }.

View File

@ -31,7 +31,7 @@ force_gc_conf() ->
#{bytes => 16777216, count => 16000, enable => true}. #{bytes => 16777216, count => 16000, enable => true}.
force_shutdown_conf() -> force_shutdown_conf() ->
#{enable => true, max_heap_size => 4194304, max_message_queue_len => 1000}. #{enable => true, max_heap_size => 4194304, max_mailbox_size => 1000}.
rpc_conf() -> rpc_conf() ->
#{ #{

View File

@ -1,7 +1,7 @@
%% -*- mode: erlang -*- %% -*- mode: erlang -*-
{application, emqx_gateway, [ {application, emqx_gateway, [
{description, "The Gateway management application"}, {description, "The Gateway management application"},
{vsn, "0.1.15"}, {vsn, "0.1.16"},
{registered, []}, {registered, []},
{mod, {emqx_gateway_app, []}}, {mod, {emqx_gateway_app, []}},
{applications, [kernel, stdlib, emqx, emqx_authn, emqx_ctl]}, {applications, [kernel, stdlib, emqx, emqx_authn, emqx_ctl]},

View File

@ -78,7 +78,7 @@
-define(DEFAULT_GC_OPTS, #{count => 1000, bytes => 1024 * 1024}). -define(DEFAULT_GC_OPTS, #{count => 1000, bytes => 1024 * 1024}).
-define(DEFAULT_OOM_POLICY, #{ -define(DEFAULT_OOM_POLICY, #{
max_heap_size => 4194304, max_heap_size => 4194304,
max_message_queue_len => 32000 max_mailbox_size => 32000
}). }).
-elvis([{elvis_style, god_modules, disable}]). -elvis([{elvis_style, god_modules, disable}]).

View File

@ -230,7 +230,7 @@ check_oom(Policy) ->
check_oom(_Pid, #{enable := false}) -> check_oom(_Pid, #{enable := false}) ->
ok; ok;
check_oom(Pid, #{ check_oom(Pid, #{
max_message_queue_len := MaxQLen, max_mailbox_size := MaxQLen,
max_heap_size := MaxHeapSize max_heap_size := MaxHeapSize
}) -> }) ->
case process_info(Pid, [message_queue_len, total_heap_size]) of case process_info(Pid, [message_queue_len, total_heap_size]) of

View File

@ -140,7 +140,7 @@ t_index_of(_) ->
t_check(_) -> t_check(_) ->
Policy = #{ Policy = #{
max_message_queue_len => 10, max_mailbox_size => 10,
max_heap_size => 1024 * 1024 * 8, max_heap_size => 1024 * 1024 * 8,
enable => true enable => true
}, },

View File

@ -0,0 +1 @@
Renamed `max_message_queue_len` to `max_mailbox_size` in the `force_shutdown` configuration. Old name is kept as an alias, so this change is backward compatible.

View File

@ -337,11 +337,11 @@ fields_mqtt_quic_listener_retry_memory_limit.desc:
fields_mqtt_quic_listener_retry_memory_limit.label: fields_mqtt_quic_listener_retry_memory_limit.label:
"""Retry memory limit""" """Retry memory limit"""
force_shutdown_max_message_queue_len.desc: force_shutdown_max_mailbox_size.desc:
"""Maximum message queue length.""" """In EMQX, each online client corresponds to an individual Erlang process. The configuration value establishes a mailbox size limit for these processes. If the mailbox size surpasses this limit, the client will be automatically terminated."""
force_shutdown_max_message_queue_len.label: force_shutdown_max_mailbox_size.label:
"""Maximum mailbox queue length of process.""" """Maximum mailbox size."""
sys_heartbeat_interval.desc: sys_heartbeat_interval.desc:
"""Time interval for publishing following heartbeat messages: """Time interval for publishing following heartbeat messages:

View File

@ -324,11 +324,11 @@ fields_mqtt_quic_listener_retry_memory_limit.desc:
fields_mqtt_quic_listener_retry_memory_limit.label: fields_mqtt_quic_listener_retry_memory_limit.label:
"""重试内存限制""" """重试内存限制"""
force_shutdown_max_message_queue_len.desc: force_shutdown_max_mailbox_size.desc:
"""消息队列的最大长度。""" """每个在线客户端在 EMQX 服务器中都是独立的一个进程。该配置可以设为单个进程的邮箱消息队列设置最大长度,当超过该上限时,客户端会被强制下线。"""
force_shutdown_max_message_queue_len.label: force_shutdown_max_mailbox_size.label:
"""进程邮箱消息队列的最大长度""" """进程邮箱消息数上限"""
sys_heartbeat_interval.desc: sys_heartbeat_interval.desc:
"""发送心跳系统消息的间隔时间,它包括: """发送心跳系统消息的间隔时间,它包括: