From 8f07f26744d1ee1fa546dcadcc9d6d7ba13366d8 Mon Sep 17 00:00:00 2001 From: JianBo He Date: Thu, 11 Nov 2021 11:28:17 +0800 Subject: [PATCH] fix: ensure starting listeners before plugins --- src/emqx_app.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/emqx_app.erl b/src/emqx_app.erl index 8d0ff11a8..be6f45e25 100644 --- a/src/emqx_app.erl +++ b/src/emqx_app.erl @@ -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(),