chore: add comment for init_loader_done
This commit is contained in:
parent
c4ba558ee3
commit
802a50601a
|
@ -96,6 +96,8 @@ format_list(Listener) ->
|
||||||
|
|
||||||
do_list_raw() ->
|
do_list_raw() ->
|
||||||
%% GET /listeners from other nodes returns [] when init config is not loaded.
|
%% GET /listeners from other nodes returns [] when init config is not loaded.
|
||||||
|
%% FIXME This is a workaround for the issue:
|
||||||
|
%% mria:running_nodes() sometime return node which not ready to accept rpc call.
|
||||||
case emqx_app:init_load_done() of
|
case emqx_app:init_load_done() of
|
||||||
true ->
|
true ->
|
||||||
Key = <<"listeners">>,
|
Key = <<"listeners">>,
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
-export([start/2, stop/1]).
|
-export([start/2, stop/1]).
|
||||||
-export([get_override_config_file/0]).
|
-export([get_override_config_file/0]).
|
||||||
-export([sync_data_from_node/0]).
|
-export([sync_data_from_node/0]).
|
||||||
|
-export([unset_config_loaded/0]).
|
||||||
|
|
||||||
-include_lib("emqx/include/logger.hrl").
|
-include_lib("emqx/include/logger.hrl").
|
||||||
-include("emqx_conf.hrl").
|
-include("emqx_conf.hrl").
|
||||||
|
@ -42,6 +43,11 @@ start(_StartType, _StartArgs) ->
|
||||||
stop(_State) ->
|
stop(_State) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
%% @doc emqx_conf relies on this flag to synchronize configuration between nodes.
|
||||||
|
%% Therefore, we must clean up this flag when emqx application is restarted by mria.
|
||||||
|
unset_config_loaded() ->
|
||||||
|
emqx_app:unset_config_loaded().
|
||||||
|
|
||||||
%% Read the cluster config from the local node.
|
%% Read the cluster config from the local node.
|
||||||
%% This function is named 'override' due to historical reasons.
|
%% This function is named 'override' due to historical reasons.
|
||||||
get_override_config_file() ->
|
get_override_config_file() ->
|
||||||
|
|
|
@ -61,7 +61,7 @@ start_autocluster() ->
|
||||||
stop_apps() ->
|
stop_apps() ->
|
||||||
?SLOG(notice, #{msg => "stopping_emqx_apps"}),
|
?SLOG(notice, #{msg => "stopping_emqx_apps"}),
|
||||||
_ = emqx_alarm_handler:unload(),
|
_ = emqx_alarm_handler:unload(),
|
||||||
ok = emqx_app:unset_config_loaded(),
|
ok = emqx_conf_app:unset_config_loaded(),
|
||||||
lists:foreach(fun stop_one_app/1, lists:reverse(sorted_reboot_apps())).
|
lists:foreach(fun stop_one_app/1, lists:reverse(sorted_reboot_apps())).
|
||||||
|
|
||||||
%% Those port apps are terminated after the main apps
|
%% Those port apps are terminated after the main apps
|
||||||
|
|
Loading…
Reference in New Issue