Skip to content

Commit e18cd06

Browse files
author
Daniil Fedotov
committed
Log stopping applications
1 parent 3b8d508 commit e18cd06

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/rabbit.erl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,9 @@ start_it(StartFun) ->
434434
stop() ->
435435
case whereis(rabbit_boot) of
436436
undefined -> ok;
437-
_ -> await_startup(true)
437+
_ ->
438+
rabbit_log:info("Waiting for RabbitMQ to startup before stopping"),
439+
await_startup(true)
438440
end,
439441
rabbit_log:info("Stopping RabbitMQ~n", []),
440442
Apps = ?APPS ++ rabbit_plugins:active(),
@@ -444,8 +446,14 @@ stop() ->
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 in 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

0 commit comments

Comments
 (0)