Skip to content

Commit 61a1c88

Browse files
Daniil FedotovGerhard Lazu
authored andcommitted
Replace await_startup with new implementation
Signed-off-by: Gerhard Lazu <[email protected]> [#145043957]
1 parent ddcdf46 commit 61a1c88

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

src/rabbit.erl

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
-behaviour(application).
2020

2121
-export([start/0, boot/0, stop/0,
22-
stop_and_halt/0, await_startup/0, await_startup2/0, status/0, is_running/0,
22+
stop_and_halt/0, await_startup/0, status/0, is_running/0,
2323
is_running/1, environment/0, rotate_logs/1, force_event_refresh/1,
2424
start_fhc/0]).
2525
-export([start/2, stop/1]).
@@ -604,22 +604,6 @@ handle_app_error(Term) ->
604604
end.
605605

606606
await_startup() ->
607-
await_startup(false).
608-
609-
await_startup(HaveSeenRabbitBoot) ->
610-
%% We don't take absence of rabbit_boot as evidence we've started,
611-
%% since there's a small window before it is registered.
612-
case whereis(rabbit_boot) of
613-
undefined -> case HaveSeenRabbitBoot orelse is_running() of
614-
true -> ok;
615-
false -> timer:sleep(100),
616-
await_startup(false)
617-
end;
618-
_ -> timer:sleep(100),
619-
await_startup(true)
620-
end.
621-
622-
await_startup2() ->
623607
case is_booting() of
624608
true -> wait_to_finish_booting();
625609
false ->

src/rabbit_control_main.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ wait_for_application(Node, Pid, Application) ->
787787

788788
wait_for_startup(Node, Pid) ->
789789
while_process_is_alive(
790-
Node, Pid, fun() -> rpc:call(Node, rabbit, await_startup2, []) =:= ok end).
790+
Node, Pid, fun() -> rpc:call(Node, rabbit, await_startup, []) =:= ok end).
791791

792792
while_process_is_alive(Node, Pid, Activity) ->
793793
case rabbit_misc:is_os_process_alive(Pid) of

0 commit comments

Comments
 (0)