Merge pull request #8254 from zhongwencool/plugin-start-timeout

fix: install plugins timeout by deadlock
This commit is contained in:
Zaiming (Stone) Shi 2022-06-17 06:03:04 +01:00 committed by GitHub
commit 0383047b17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -648,7 +648,8 @@ put_config(Key, Value) when is_atom(Key) ->
put_config([Key], Value); put_config([Key], Value);
put_config(Path, Values) when is_list(Path) -> put_config(Path, Values) when is_list(Path) ->
Opts = #{rawconf_with_defaults => true, override_to => cluster}, Opts = #{rawconf_with_defaults => true, override_to => cluster},
case emqx_conf:update([?CONF_ROOT | Path], bin_key(Values), Opts) of %% Already in cluster_rpc, don't use emqx_conf:update, dead calls
case emqx:update_config([?CONF_ROOT | Path], bin_key(Values), Opts) of
{ok, _} -> ok; {ok, _} -> ok;
Error -> Error Error -> Error
end. end.

View File

@ -125,8 +125,8 @@ purge_test() ->
meck_emqx() -> meck_emqx() ->
meck:new(emqx, [unstick, passthrough]), meck:new(emqx, [unstick, passthrough]),
meck:expect( meck:expect(
emqx_conf, emqx,
update, update_config,
fun(Path, Values, _Opts) -> fun(Path, Values, _Opts) ->
emqx_config:put(Path, Values) emqx_config:put(Path, Values)
end end