客户端频繁断开连接

  • emqx版本:4.0.0
  • 问题描述:客户端频繁断开连接
  • 问题日志:
    2024-03-26 22:51:10.068 [error] <<“d11ca387-3b43-45ce-a9bc-d60461faf677”>>@127.0.0.1:38932 crasher:
    initial call: emqx_connection:init/4
    pid: <0.31324.1>
    registered_name:
    exception exit: {badarg,
    [{ets,lookup_element,
    [emqx_metrics,‘packets.publish.inuse’,4],
    },
    {emqx_metrics,update_counter,2,
    [{file,
    “/emqx-rel/_build/emqx-pkg/lib/emqx/src/emqx_metrics.erl”},
    {line,294}]},
    {emqx_channel,do_publish,3,
    [{file,
    “/emqx-rel/_build/emqx-pkg/lib/emqx/src/emqx_channel.erl”},
    {line,416}]},
    {emqx_connection,with_channel,3,
    [{file,
    “/emqx-rel/_build/emqx-pkg/lib/emqx/src/emqx_connection.erl”},
    {line,537}]},
    {emqx_connection,process_msg,3,
    [{file,
    “/emqx-rel/_build/emqx-pkg/lib/emqx/src/emqx_connection.erl”},
    {line,284}]},
    {proc_lib,wake_up,3,
    [{file,“proc_lib.erl”},{line,259}]}]}
    in function emqx_connection:terminate/2 (/emqx-rel/_build/emqx-pkg/lib/emqx/src/emqx_connection.erl, line 424)
    ancestors: [<0.1582.0>,<0.1581.0>,esockd_sup,<0.1341.0>]
    message_queue_len: 0
    messages:
    links: [<0.1582.0>]
    dictionary: [{{publish,<<“/devices/agvc/heartBeat/sr2019072600001”>>},
    {allow,1711464610910}},
    {{publish,<<“/devices/agvc/appoint/sr2019072600001”>>},
    {allow,1711464647969}},
    {{publish,
    <<“/devices/agvc/applyMutualExclusionAreaFeedback/sr2019072600001”>>},
    {allow,1711464669550}},
    {recv_msg,1701},
    {guid,{1711464670067993,268564321827420,1701}},
    {recv_pkt,2786},
    {acl_cache_size,7},
    {acl_keys_q,
    {[{publish,
    <<“/devices/agvc/applyMutualExclusionAreaFeedback/sr2019072600001”>>},
    {publish,
    <<“/devices/agvc/applyRestrictZoneFeedback/sr2019072600001”>>},
    {publish,
    <<“/devices/rcs/robotErrorInfo/c2f3114d13df4bc09939ce5f0cfa7ad1”>>},
    {publish,<<“/devices/agvc/appoint/sr2019072600001”>>},
    {publish,
    <<“/devices/agvc/obstacleDetectFinish/sr2019072600001”>>},
    {publish,
    <<“/devices/agvc/obstacleDetect/sr2019072600001”>>}],
    [{publish,
    <<“/devices/agvc/heartBeat/sr2019072600001”>>}]}},
    {{publish,
    <<“/devices/agvc/obstacleDetect/sr2019072600001”>>},
    {allow,1711464622113}},
    {{publish,
    <<“/devices/agvc/applyRestrictZoneFeedback/sr2019072600001”>>},
    {allow,1711464655719}},
    {send_pkt,39366},
    {send_msg,38322},
    {{publish,
    <<“/devices/agvc/obstacleDetectFinish/sr2019072600001”>>},
    {allow,1711464645215}},
    {incoming_pubs,54},
    {{publish,
    <<“/devices/rcs/robotErrorInfo/c2f3114d13df4bc09939ce5f0cfa7ad1”>>},
    {allow,1711464655510}},
    {incoming_bytes,7676},
    {‘$logger_metadata$’,
    #{clientid => <<“d11ca387-3b43-45ce-a9bc-d60461faf677”>>,
    peername => “127.0.0.1:38932”}},
    {outgoing_bytes,10702},
    {outgoing_pubs,30}]
    trap_exit: false
    status: running
    heap_size: 2586
    stack_size: 27
    reductions: 15381221
    neighbours:

2024-03-26 22:51:10.069 [error] supervisor: ‘esockd_connection_sup - <0.1582.0>’
errorContext: connection_crashed
reason: {badarg,
[{ets,lookup_element,
[emqx_metrics,‘packets.publish.inuse’,4],
},
{emqx_metrics,update_counter,2,
[{file,
“/emqx-rel/_build/emqx-pkg/lib/emqx/src/emqx_metrics.erl”},
{line,294}]},
{emqx_channel,do_publish,3,
[{file,
“/emqx-rel/_build/emqx-pkg/lib/emqx/src/emqx_channel.erl”},
{line,416}]},
{emqx_connection,with_channel,3,
[{file,
“/emqx-rel/_build/emqx-pkg/lib/emqx/src/emqx_connection.erl”},
{line,537}]},
{emqx_connection,process_msg,3,
[{file,
“/emqx-rel/_build/emqx-pkg/lib/emqx/src/emqx_connection.erl”},
{line,284}]},
{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,259}]}]}
offender: [{pid,<0.31324.1>},
{name,connection},
{mfargs,
{emqx_connection,start_link,
[[{deflate_options,},
{max_conn_rate,1000},
{active_n,100},
{zone,external}]]}}]
附图:



@xuliang
4.0 已经没维护了,建议升级到最新版本

请问从日志可以看出是什么原因导致的吗