Skip to content

Commit 0ded88c

Browse files
Merge branch 'stable' into rabbitmq-server-1136
2 parents ab29c48 + b40bf8c commit 0ded88c

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/rabbit.erl

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,18 +434,26 @@ start_it(StartFun) ->
434434
stop() ->
435435
case whereis(rabbit_boot) of
436436
undefined -> ok;
437-
_ -> await_startup(true)
437+
_ ->
438+
rabbit_log:info("RabbitMQ hasn't finished starting yet. Waiting for startup to finish before stopping..."),
439+
await_startup(true)
438440
end,
439-
rabbit_log:info("Stopping RabbitMQ~n", []),
441+
rabbit_log:info("RabbitMQ is asked to stop...~n", []),
440442
Apps = ?APPS ++ rabbit_plugins:active(),
441443
stop_apps(app_utils:app_dependency_order(Apps, true)),
442-
rabbit_log:info("Stopped RabbitMQ application~n", []).
444+
rabbit_log:info("Successfully stopped RabbitMQ and its dependencies~n", []).
443445

444446
stop_and_halt() ->
445447
try
446448
stop()
449+
catch Type:Reason ->
450+
rabbit_log:error("Error trying to stop RabbitMQ: ~p:~p", [Type, Reason])
447451
after
448-
rabbit_log:info("Halting Erlang VM~n", []),
452+
AppsLeft = [ A || {A, _, _} <- application:which_applications() ],
453+
rabbit_log:info(
454+
lists:flatten(["Halting Erlang VM with the following applications:~n",
455+
[" ~p~n" || _ <- AppsLeft]]),
456+
AppsLeft),
449457
%% Also duplicate this information to stderr, so console where
450458
%% foreground broker was running (or systemd journal) will
451459
%% contain information about graceful termination.
@@ -569,6 +577,10 @@ decrypt_list([Value|Tail], Algo, Acc) ->
569577
decrypt_list(Tail, Algo, [decrypt(Value, Algo)|Acc]).
570578

571579
stop_apps(Apps) ->
580+
rabbit_log:info(
581+
lists:flatten(["Stopping RabbitMQ applications and their dependencies in the following order: ~n",
582+
[" ~p~n" || _ <- Apps]]),
583+
lists:reverse(Apps)),
572584
ok = app_utils:stop_applications(
573585
Apps, handle_app_error(error_during_shutdown)),
574586
case lists:member(rabbit, Apps) of

src/rabbit_msg_store.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ terminate(_Reason, State = #msstate { index_state = IndexState,
985985
flying_ets = FlyingEts,
986986
clients = Clients,
987987
dir = Dir }) ->
988+
rabbit_log:info("Stopping message store for directory '~s'", [Dir]),
988989
%% stop the gc first, otherwise it could be working and we pull
989990
%% out the ets tables from under it.
990991
ok = rabbit_msg_store_gc:stop(GCPid),
@@ -1001,6 +1002,7 @@ terminate(_Reason, State = #msstate { index_state = IndexState,
10011002
IndexModule:terminate(IndexState),
10021003
ok = store_recovery_terms([{client_refs, dict:fetch_keys(Clients)},
10031004
{index_module, IndexModule}], Dir),
1005+
rabbit_log:info("Message store for directory '~s' is stopped", [Dir]),
10041006
State3 #msstate { index_state = undefined,
10051007
current_file_handle = undefined }.
10061008

0 commit comments

Comments
 (0)