@@ -870,11 +870,29 @@ start(normal, []) ->
870
870
log_banner (),
871
871
warn_if_kernel_config_dubious (),
872
872
warn_if_disc_io_options_dubious (),
873
- % % We run `rabbit` boot steps only for now. Plugins boot steps
874
- % % will be executed as part of the postlaunch phase after they
875
- % % are started.
876
- rabbit_boot_steps :run_boot_steps ([rabbit ]),
877
- run_postlaunch_phase (),
873
+
874
+ rabbit_log_prelaunch :debug (" " ),
875
+ rabbit_log_prelaunch :debug (" == Plugins (prelaunch phase) ==" ),
876
+
877
+ rabbit_log_prelaunch :debug (" Setting plugins up" ),
878
+ % % `Plugins` contains all the enabled plugins, plus their
879
+ % % dependencies. The order is important: dependencies appear
880
+ % % before plugin which depend on them.
881
+ Plugins = rabbit_plugins :setup (),
882
+ rabbit_log_prelaunch :debug (
883
+ " Loading the following plugins: ~p " , [Plugins ]),
884
+ % % We can load all plugins and refresh their feature flags at
885
+ % % once, because it does not involve running code from the
886
+ % % plugins.
887
+ app_utils :load_applications (Plugins ),
888
+ ok = rabbit_feature_flags :refresh_feature_flags_after_app_load (
889
+ Plugins ),
890
+
891
+ rabbit_log_prelaunch :debug (" " ),
892
+ rabbit_log_prelaunch :debug (" == Boot steps ==" ),
893
+
894
+ ok = rabbit_boot_steps :run_boot_steps ([rabbit | Plugins ]),
895
+ run_postlaunch_phase (Plugins ),
878
896
{ok , SupPid }
879
897
catch
880
898
throw :{error , _ } = Error ->
@@ -893,45 +911,34 @@ start(normal, []) ->
893
911
Error
894
912
end .
895
913
896
- run_postlaunch_phase () ->
897
- spawn (fun () -> do_run_postlaunch_phase () end ).
914
+ run_postlaunch_phase (Plugins ) ->
915
+ spawn (fun () -> do_run_postlaunch_phase (Plugins ) end ).
898
916
899
- do_run_postlaunch_phase () ->
917
+ do_run_postlaunch_phase (Plugins ) ->
900
918
% % Once RabbitMQ itself is started, we need to run a few more steps,
901
919
% % in particular start plugins.
902
920
rabbit_log_prelaunch :debug (" " ),
903
921
rabbit_log_prelaunch :debug (" == Postlaunch phase ==" ),
904
922
905
923
try
906
924
rabbit_log_prelaunch :debug (" " ),
907
- rabbit_log_prelaunch :debug (" == Plugins ==" ),
925
+ rabbit_log_prelaunch :debug (" == Plugins (postlaunch phase) ==" ),
908
926
909
- rabbit_log_prelaunch :debug (" Setting plugins up" ),
910
- % % `Plugins` contains all the enabled plugins, plus their
911
- % % dependencies. The order is important: dependencies appear
912
- % % before plugin which depend on them.
913
- Plugins = rabbit_plugins :setup (),
914
- rabbit_log_prelaunch :debug (
915
- " Starting the following plugins: ~p " , [Plugins ]),
916
- % % We can load all plugins and refresh their feature flags at
917
- % % once, because it does not involve running code from the
918
- % % plugins.
919
- app_utils :load_applications (Plugins ),
920
- ok = rabbit_feature_flags :refresh_feature_flags_after_app_load (
921
- Plugins ),
922
927
% % However, we want to run their boot steps and actually start
923
928
% % them one by one, to ensure a dependency is fully started
924
929
% % before a plugin which depends on it gets a chance to start.
930
+ rabbit_log_prelaunch :debug (
931
+ " Starting the following plugins: ~p " , [Plugins ]),
925
932
lists :foreach (
926
933
fun (Plugin ) ->
927
- ok = rabbit_boot_steps :run_boot_steps ([Plugin ]),
928
934
case application :ensure_all_started (Plugin ) of
929
935
{ok , _ } -> ok ;
930
936
Error -> throw (Error )
931
937
end
932
938
end , Plugins ),
933
939
934
940
% % Successful boot resets node maintenance state.
941
+ rabbit_log_prelaunch :debug (" " ),
935
942
rabbit_log_prelaunch :info (" Resetting node maintenance status" ),
936
943
_ = rabbit_maintenance :unmark_as_being_drained (),
937
944
0 commit comments