Skip to content

Commit 404f06b

Browse files
committed
rabbit_boot_state: Add prelaunch_done state
[Why] We will need it to indicate `rabbit` is not running, while not stopping the Erlang application. In this state, only the Feature flags subsystem and logging are configured. This will be used to leave `rabbit` running to perform changes to the cluster membership while not running the full service.
1 parent a734429 commit 404f06b

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

deps/rabbit/src/rabbit.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ run_prelaunch_second_phase() ->
369369
%% 3. Logging.
370370
ok = rabbit_prelaunch_logging:setup(Context),
371371

372+
rabbit_boot_state:set(prelaunch_done),
373+
372374
%% The clustering steps requires Khepri to be started to check for
373375
%% consistency. This is the opposite compared to Mnesia which must be
374376
%% stopped. That's why we setup Khepri and the coordination Ra system it

deps/rabbitmq_prelaunch/src/rabbit_boot_state.erl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
-type boot_state() :: stopped |
2828
booting |
29+
prelaunch_done |
2930
core_started |
3031
ready |
3132
stopping.
@@ -66,11 +67,12 @@ wait_for(BootState, Timeout)
6667
wait_for(_, _) ->
6768
{error, timeout}.
6869

69-
boot_state_idx(stopped) -> 0;
70-
boot_state_idx(booting) -> 1;
71-
boot_state_idx(core_started) -> 2;
72-
boot_state_idx(ready) -> 3;
73-
boot_state_idx(stopping) -> 4.
70+
boot_state_idx(stopped) -> 0;
71+
boot_state_idx(booting) -> 1;
72+
boot_state_idx(prelaunch_done) -> 2;
73+
boot_state_idx(core_started) -> 3;
74+
boot_state_idx(ready) -> 4;
75+
boot_state_idx(stopping) -> 5.
7476

7577
is_valid(BootState) ->
7678
is_integer(boot_state_idx(BootState)).

0 commit comments

Comments
 (0)