Skip to content

Commit

Permalink
Report long register_on_remote_node calls
Browse files Browse the repository at this point in the history
Limit rpc call to 10 seconds
  • Loading branch information
arcusfelis committed Dec 13, 2024
1 parent 3d4cfb4 commit 0dcad73
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/mongoose_start_node_id.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0dcad73

Please sign in to comment.