Merge pull request #8806 from zhongwencool/copy-of-main-v4.3

chore: sync v4.3 to v4.4
This commit is contained in:
zhongwencool 2022-08-25 21:40:31 +08:00 committed by GitHub
commit 3a39bde3dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 14 deletions

View File

@ -1,12 +1,16 @@
%% -*- mode: erlang -*-
%% Unless you know what you are doing, DO NOT edit manually!!
{VSN,
[{"4.4.5",[{load_module,emqx_mod_trace_api,brutal_purge,soft_purge,[]}]},
[{"4.4.5",
[{load_module,emqx_mod_trace_api,brutal_purge,soft_purge,[]},
{load_module,emqx_modules,brutal_purge,soft_purge,[]}]},
{"4.4.4",
[{load_module,emqx_mod_rewrite,brutal_purge,soft_purge,[]},
{load_module,emqx_modules,brutal_purge,soft_purge,[]},
{load_module,emqx_mod_trace_api,brutal_purge,soft_purge,[]}]},
{"4.4.3",
[{load_module,emqx_mod_rewrite,brutal_purge,soft_purge,[]},
{load_module,emqx_modules,brutal_purge,soft_purge,[]},
{load_module,emqx_mod_trace_api,brutal_purge,soft_purge,[]}]},
{"4.4.2",
[{load_module,emqx_mod_rewrite,brutal_purge,soft_purge,[]},
@ -27,12 +31,16 @@
{load_module,emqx_mod_sup,brutal_purge,soft_purge,[]},
{load_module,emqx_mod_trace_api,brutal_purge,soft_purge,[]}]},
{<<".*">>,[]}],
[{"4.4.5",[{load_module,emqx_mod_trace_api,brutal_purge,soft_purge,[]}]},
[{"4.4.5",
[{load_module,emqx_mod_trace_api,brutal_purge,soft_purge,[]},
{load_module,emqx_modules,brutal_purge,soft_purge,[]}]},
{"4.4.4",
[{load_module,emqx_mod_rewrite,brutal_purge,soft_purge,[]},
{load_module,emqx_modules,brutal_purge,soft_purge,[]},
{load_module,emqx_mod_trace_api,brutal_purge,soft_purge,[]}]},
{"4.4.3",
[{load_module,emqx_mod_rewrite,brutal_purge,soft_purge,[]},
{load_module,emqx_modules,brutal_purge,soft_purge,[]},
{load_module,emqx_mod_trace_api,brutal_purge,soft_purge,[]}]},
{"4.4.2",
[{load_module,emqx_mod_rewrite,brutal_purge,soft_purge,[]},

View File

@ -62,12 +62,13 @@ load(ModuleName) ->
%% @doc Creates a `loaded_modules' file with default values if one
%% doesn't exist.
-spec ensure_loaded_modules_file(file:filename()) -> ok.
ensure_loaded_modules_file(Filepath) ->
case filelib:is_regular(Filepath) of
ensure_loaded_modules_file(FilePath) ->
case filelib:is_regular(FilePath) of
true ->
ok;
false ->
do_ensure_loaded_modules_file(Filepath)
?LOG(warning, "~s is not found, use the default modules instead", [FilePath]),
do_ensure_loaded_modules_file(FilePath)
end.
do_ensure_loaded_modules_file(Filepath) ->

View File

@ -41,6 +41,7 @@
[ {gpb, "4.11.2"} %% gpb only used to build, but not for release, pin it here to avoid fetching a wrong version due to rebar plugins scattered in all the deps
, {redbug, "2.0.7"}
, {ehttpc, {git, "https://github.com/emqx/ehttpc", {tag, "0.2.0"}}}
, {gun, {git, "https://github.com/emqx/gun", {tag, "1.3.7"}}}
, {eredis_cluster, {git, "https://github.com/emqx/eredis_cluster", {tag, "0.7.3"}}}
, {gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}}
, {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}}

View File

@ -218,6 +218,7 @@ ensure_file(File) ->
case filelib:is_file(File) of
false ->
DefaultPlugins = default_plugins(),
?LOG(warning, "~s is not found, use the default plugins instead", [File]),
write_loaded(DefaultPlugins);
true ->
ok

View File

@ -112,8 +112,7 @@ default_plugins() ->
{emqx_modules, true},
{emqx_recon, true},
{emqx_retainer, false},
{emqx_rule_engine, true},
{emqx_telemetry, true}
{emqx_rule_engine, true}
].
-endif.

View File

@ -353,7 +353,7 @@ t_local(_) ->
ok = ensure_group_config(Node, GroupConfig),
ok = ensure_group_config(GroupConfig),
Topic = <<"local_foo/bar">>,
Topic = <<"local_foo1/bar">>,
ClientId1 = <<"ClientId1">>,
ClientId2 = <<"ClientId2">>,
@ -363,8 +363,8 @@ t_local(_) ->
{ok, _} = emqtt:connect(ConnPid1),
{ok, _} = emqtt:connect(ConnPid2),
emqtt:subscribe(ConnPid1, {<<"$share/local_group/local_foo/bar">>, 0}),
emqtt:subscribe(ConnPid2, {<<"$share/local_group/local_foo/bar">>, 0}),
emqtt:subscribe(ConnPid1, {<<"$share/local_group/", Topic/binary>>, 0}),
emqtt:subscribe(ConnPid2, {<<"$share/local_group/", Topic/binary>>, 0}),
ct:sleep(100),
@ -396,7 +396,7 @@ t_local_fallback(_) ->
<<"sticky_group">> => sticky
}),
Topic = <<"local_foo/bar">>,
Topic = <<"local_foo2/bar">>,
ClientId1 = <<"ClientId1">>,
ClientId2 = <<"ClientId2">>,
Node = start_slave('local_fallback_shared_sub_test19', 11885),
@ -406,12 +406,12 @@ t_local_fallback(_) ->
Message1 = emqx_message:make(ClientId1, 0, Topic, <<"hello1">>),
Message2 = emqx_message:make(ClientId2, 0, Topic, <<"hello2">>),
emqtt:subscribe(ConnPid1, {<<"$share/local_group_fallback/local_foo/bar">>, 0}),
emqtt:subscribe(ConnPid1, {<<"$share/local_group_fallback/", Topic/binary>>, 0}),
[{share, <<"local_foo/bar">>, {ok, 1}}] = emqx:publish(Message1),
[{share, Topic, {ok, 1}}] = emqx:publish(Message1),
{true, UsedSubPid1} = last_message(<<"hello1">>, [ConnPid1]),
[{share, <<"local_foo/bar">>, {ok, 1}}] = rpc:call(Node, emqx, publish, [Message2]),
[{share, Topic, {ok, 1}}] = rpc:call(Node, emqx, publish, [Message2]),
{true, UsedSubPid2} = last_message(<<"hello2">>, [ConnPid1]),
emqtt:stop(ConnPid1),