diff options
| -rw-r--r-- | src/rabbit.erl | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 2d16661768..d748fdaf7c 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -280,9 +280,11 @@ start() -> HipeResult = rabbit_hipe:maybe_hipe_compile(), ok = start_logger(), rabbit_hipe:log_hipe_result(HipeResult), + Apps = load_all_apps(), + rabbit_feature_flags:initialize_registry(), rabbit_node_monitor:prepare_cluster_status_files(), rabbit_mnesia:check_cluster_consistency(), - broker_start() + broker_start(Apps) end). -spec boot() -> 'ok'. @@ -294,13 +296,15 @@ boot() -> HipeResult = rabbit_hipe:maybe_hipe_compile(), ok = start_logger(), rabbit_hipe:log_hipe_result(HipeResult), + Apps = load_all_apps(), + rabbit_feature_flags:initialize_registry(), rabbit_node_monitor:prepare_cluster_status_files(), ok = rabbit_upgrade:maybe_upgrade_mnesia(), %% It's important that the consistency check happens after %% the upgrade, since if we are a secondary node the %% primary node will have forgotten us rabbit_mnesia:check_cluster_consistency(), - broker_start() + broker_start(Apps) end). ensure_config() -> @@ -321,11 +325,14 @@ ensure_config() -> ok -> ok end. - -broker_start() -> +load_all_apps() -> Plugins = rabbit_plugins:setup(), ToBeLoaded = Plugins ++ ?APPS, - start_apps(ToBeLoaded), + app_utils:load_applications(ToBeLoaded), + ToBeLoaded. + +broker_start(Apps) -> + start_loaded_apps(Apps), maybe_sd_notify(), ok = rabbit_lager:broker_is_started(), ok = log_broker_started(rabbit_plugins:strictly_plugins(rabbit_plugins:active())). @@ -518,6 +525,12 @@ start_apps(Apps) -> start_apps(Apps, RestartTypes) -> app_utils:load_applications(Apps), rabbit_feature_flags:initialize_registry(), + start_loaded_apps(Apps, RestartTypes). + +start_loaded_apps(Apps) -> + start_loaded_apps(Apps, #{}). + +start_loaded_apps(Apps, RestartTypes) -> ensure_sysmon_handler_app_config(), %% make Ra use a custom logger that dispatches to lager instead of the %% default OTP logger |
