chore: add comment for init_loader_done

This commit is contained in:
zhongwencool 2023-07-10 12:03:36 +08:00
parent c4ba558ee3
commit 802a50601a
3 changed files with 9 additions and 1 deletions

View File

@ -96,6 +96,8 @@ format_list(Listener) ->
do_list_raw() ->
%% 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
true ->
Key = <<"listeners">>,

View File

@ -21,6 +21,7 @@
-export([start/2, stop/1]).
-export([get_override_config_file/0]).
-export([sync_data_from_node/0]).
-export([unset_config_loaded/0]).
-include_lib("emqx/include/logger.hrl").
-include("emqx_conf.hrl").
@ -42,6 +43,11 @@ start(_StartType, _StartArgs) ->
stop(_State) ->
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.
%% This function is named 'override' due to historical reasons.
get_override_config_file() ->

View File

@ -61,7 +61,7 @@ start_autocluster() ->
stop_apps() ->
?SLOG(notice, #{msg => "stopping_emqx_apps"}),
_ = 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())).
%% Those port apps are terminated after the main apps