Explorar o código

fix(cm): add a timeout to rpc_call function

An infinite wait will leave the client process waiting for
a return and cause the client to go to a dead state
JianBo He %!s(int64=4) %!d(string=hai) anos
pai
achega
240a4b88a5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/emqx_cm.erl

+ 1 - 1
src/emqx_cm.erl

@@ -376,7 +376,7 @@ lookup_channels(local, ClientId) ->
 
 
 %% @private
 %% @private
 rpc_call(Node, Fun, Args) ->
 rpc_call(Node, Fun, Args) ->
-    case rpc:call(Node, ?MODULE, Fun, Args) of
+    case rpc:call(Node, ?MODULE, Fun, Args, 2 * ?T_TAKEOVER) of
         {badrpc, Reason} -> error(Reason);
         {badrpc, Reason} -> error(Reason);
         Res -> Res
         Res -> Res
     end.
     end.