From 0dcad736283b93ee17bd7fcf5b1e5134256a655f Mon Sep 17 00:00:00 2001 From: Mikhail Uvarov Date: Thu, 12 Dec 2024 16:14:20 +0100 Subject: [PATCH] Report long register_on_remote_node calls Limit rpc call to 10 seconds --- src/mongoose_start_node_id.erl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mongoose_start_node_id.erl b/src/mongoose_start_node_id.erl index 851f9eaf9d..1dd3ba11fe 100644 --- a/src/mongoose_start_node_id.erl +++ b/src/mongoose_start_node_id.erl @@ -96,8 +96,15 @@ code_change(_OldVsn, State, _Extra) -> {ok, State}. register_on_remote_node(RemoteNode, StartId) -> + Info = #{task => register_on_remote_node, + remote_node => RemoteNode, + start_id => StartId}, + F = fun() -> do_register_on_remote_node(RemoteNode, StartId) end, + mongoose_task:run_tracked(Info, F). + +do_register_on_remote_node(RemoteNode, StartId) -> Res = rpc:call(RemoteNode, ?MODULE, register_on_remote_node_rpc, - [node(), StartId, self()]), + [node(), StartId, self()], timer:seconds(10)), case Res of ok -> ok;