diff options
| -rw-r--r-- | src/rabbit.erl | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 84d3a9a8cd..542c4b11c3 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -236,12 +236,11 @@ -define(ASYNC_THREADS_WARNING_THRESHOLD, 8). -%% 5 minutes --define(BOOT_START_TIMEOUT, 300). +%% 1 minute +-define(BOOT_START_TIMEOUT, 1 * 60 * 1000). %% 12 hours --define(BOOT_FINISH_TIMEOUT, 43200). -%% 100ms --define(BOOT_STATUS_SAMPLING_INTERVAL, 100). +-define(BOOT_FINISH_TIMEOUT, 12 * 60 * 60 * 1000). +-define(BOOT_STATUS_CHECK_INTERVAL, 100). %%---------------------------------------------------------------------------- @@ -736,7 +735,7 @@ wait_for_boot_to_start(Node) -> wait_for_boot_to_start(Node, ?BOOT_START_TIMEOUT). wait_for_boot_to_start(Node, Timeout) -> - Iterations = Timeout div ?BOOT_STATUS_SAMPLING_INTERVAL, + Iterations = Timeout div ?BOOT_STATUS_CHECK_INTERVAL, do_wait_for_boot_to_start(Node, Iterations). do_wait_for_boot_to_start(_Node, IterationsLeft) when IterationsLeft =< 0 -> @@ -744,7 +743,7 @@ do_wait_for_boot_to_start(_Node, IterationsLeft) when IterationsLeft =< 0 -> do_wait_for_boot_to_start(Node, IterationsLeft) -> case is_booting(Node) of false -> - timer:sleep(?BOOT_STATUS_SAMPLING_INTERVAL), + timer:sleep(?BOOT_STATUS_CHECK_INTERVAL), do_wait_for_boot_to_start(Node, IterationsLeft - 1); {badrpc, _} = Err -> Err; @@ -756,7 +755,7 @@ wait_for_boot_to_finish(Node) -> wait_for_boot_to_finish(Node, ?BOOT_FINISH_TIMEOUT). wait_for_boot_to_finish(Node, Timeout) -> - Iterations = Timeout div ?BOOT_STATUS_SAMPLING_INTERVAL, + Iterations = Timeout div ?BOOT_STATUS_CHECK_INTERVAL, do_wait_for_boot_to_finish(Node, Iterations). do_wait_for_boot_to_finish(_Node, IterationsLeft) when IterationsLeft =< 0 -> @@ -774,7 +773,13 @@ do_wait_for_boot_to_finish(Node, IterationsLeft) -> {badrpc, _} = Err -> Err; true -> - timer:sleep(?BOOT_STATUS_SAMPLING_INTERVAL), + case IterationsLeft rem 100 of + %% This will be printed on the CLI command end to illustrate some + %% progress. + 0 -> io:format("Still booting, will check again in 10 seconds...~n"); + _ -> ok + end, + timer:sleep(?BOOT_STATUS_CHECK_INTERVAL), do_wait_for_boot_to_finish(Node, IterationsLeft - 1) end. |
