소스 검색

fix(rule): dead lock when update configs for rules

Shawn 4 년 전
부모
커밋
94a5965560
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      apps/emqx_machine/test/emqx_machine_SUITE.erl
  2. 2 2
      apps/emqx_rule_engine/src/emqx_rule_engine.erl

+ 1 - 1
apps/emqx_machine/test/emqx_machine_SUITE.erl

@@ -43,7 +43,7 @@ init_per_suite(Config) ->
     %%
     %%
     application:unload(emqx_authz),
     application:unload(emqx_authz),
 
 
-    emqx_common_test_helpers:start_apps([]),
+    emqx_common_test_helpers:start_apps([emqx_conf]),
     Config.
     Config.
 
 
 end_per_suite(_Config) ->
 end_per_suite(_Config) ->

+ 2 - 2
apps/emqx_rule_engine/src/emqx_rule_engine.erl

@@ -187,11 +187,11 @@ init([]) ->
     {ok, #{}}.
     {ok, #{}}.
 
 
 handle_call({insert_rule, Rule}, _From, State) ->
 handle_call({insert_rule, Rule}, _From, State) ->
-    _ = emqx_plugin_libs_rule:cluster_call(?MODULE, do_insert_rule, [Rule]),
+    do_insert_rule(Rule),
     {reply, ok, State};
     {reply, ok, State};
 
 
 handle_call({delete_rule, Rule}, _From, State) ->
 handle_call({delete_rule, Rule}, _From, State) ->
-    _ = emqx_plugin_libs_rule:cluster_call(?MODULE, do_delete_rule, [Rule]),
+    do_delete_rule(Rule),
     {reply, ok, State};
     {reply, ok, State};
 
 
 handle_call(Req, _From, State) ->
 handle_call(Req, _From, State) ->