From ceb04ba06da74061f10fce697027884549a3925b Mon Sep 17 00:00:00 2001 From: Serge Tupchii Date: Mon, 1 Apr 2024 16:42:12 +0300 Subject: [PATCH] fix(emqx_mgmt): do not attempt to get a stacktrace of a remote client connection process --- apps/emqx_management/src/emqx_mgmt.erl | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/apps/emqx_management/src/emqx_mgmt.erl b/apps/emqx_management/src/emqx_mgmt.erl index bc194f03e..0cde965f9 100644 --- a/apps/emqx_management/src/emqx_mgmt.erl +++ b/apps/emqx_management/src/emqx_mgmt.erl @@ -715,15 +715,20 @@ call_conn(ConnMod, Pid, Req) -> exit:{{shutdown, _OOMInfo}, _Location} -> {error, shutdown}; exit:timeout -> - ?SLOG( - warning, - #{ - msg => "call_client_connection_process_timeout", - request => Req, - pid => Pid, - module => ConnMod, - stacktrace => erlang:process_info(Pid, current_stacktrace) - } - ), + LogData = #{ + msg => "call_client_connection_process_timeout", + request => Req, + pid => Pid, + module => ConnMod + }, + LogData1 = + case node(Pid) =:= node() of + true -> + LogData#{stacktrace => erlang:process_info(Pid, current_stacktrace)}; + false -> + LogData + end, + + ?SLOG(warning, LogData1), {error, timeout} end.