Merge pull request #6121 from HJianBo/ensure-start-listeners-before-plugin

Ensure starting listeners before plugins loading
This commit is contained in:
JianBo He 2021-11-11 14:52:15 +08:00 committed by GitHub
commit cc7b1aa93e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,8 @@
%% -*- mode: erlang -*-
{VSN,
[{"4.3.10",[{load_module,emqx_connection,brutal_purge,soft_purge,[]}]},
[{"4.3.10",
[{load_module,emqx_app,brutal_purge,soft_purge,[]},
{load_module,emqx_connection,brutal_purge,soft_purge,[]}]},
{"4.3.9",
[{load_module,emqx_connection,brutal_purge,soft_purge,[]},
{load_module,emqx_channel,brutal_purge,soft_purge,[]},
@ -155,7 +157,9 @@
{load_module,emqx_rpc,brutal_purge,soft_purge,[]},
{load_module,emqx_app,brutal_purge,soft_purge,[]}]},
{<<".*">>,[]}],
[{"4.3.10",[{load_module,emqx_connection,brutal_purge,soft_purge,[]}]},
[{"4.3.10",
[{load_module,emqx_app,brutal_purge,soft_purge,[]},
{load_module,emqx_connection,brutal_purge,soft_purge,[]}]},
{"4.3.9",
[{load_module,emqx_connection,brutal_purge,soft_purge,[]},
{load_module,emqx_channel,brutal_purge,soft_purge,[]},

View File

@ -42,10 +42,13 @@ start(_Type, _Args) ->
ekka:start(),
{ok, Sup} = emqx_sup:start_link(),
ok = start_autocluster(),
%% We need to make sure that emqx's listeners start before plugins
%% and modules. Since if the emqx-conf module/plugin is enabled, it will
%% try to start or update the listeners with the latest configuration
emqx_boot:is_enabled(listeners) andalso (ok = emqx_listeners:start()),
ok = emqx_plugins:init(),
_ = emqx_plugins:load(),
_ = start_ce_modules(),
emqx_boot:is_enabled(listeners) andalso (ok = emqx_listeners:start()),
register(emqx, self()),
ok = emqx_alarm_handler:load(),
print_vsn(),