Skip to content

Commit b529c77

Browse files
committed
Add more info during rabbitmqctl shutdown
We want to know at which shutdown stage the command is at, and get confirmation of successful shutdown. Inform is used all over the place, is it OK to remove " ..." from all rabbitmqctl commands that use it? [#142699191]
1 parent d2eb76a commit b529c77

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/rabbit_control_main.erl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ start() ->
156156
Inform = case Quiet of
157157
true -> fun (_Format, _Args1) -> ok end;
158158
false -> fun (Format, Args1) ->
159-
io:format(Format ++ " ...~n", Args1)
159+
io:format(Format ++ "~n", Args1)
160160
end
161161
end,
162162
try
@@ -271,17 +271,20 @@ do_action(Command, Node, Args, Opts, Inform, Timeout) ->
271271
end.
272272

273273
shutdown_node_and_wait_pid_to_stop(Node, Pid, Inform) ->
274-
Inform("Shutting down RabbitMQ node ~p running at PID ~p", [Node, Pid]),
275274
Res = call(Node, {rabbit, stop_and_halt, []}),
276275
case Res of
277-
ok -> wait_for_process_death(Pid);
276+
ok ->
277+
Inform("Waiting for PID ~s to terminate", [Pid]),
278+
wait_for_process_death(Pid),
279+
Inform("RabbitMQ node running at PID ~s successfully shut down", [Pid]);
278280
_ -> ok
279281
end,
280282
Res.
281283

282284
action(shutdown, Node, [], _Opts, Inform) ->
283285
case rpc:call(Node, os, getpid, []) of
284286
Pid when is_list(Pid) ->
287+
Inform("Shutting down RabbitMQ node ~p running at PID ~s", [Node, Pid]),
285288
shutdown_node_and_wait_pid_to_stop(Node, Pid, Inform);
286289
Error -> Error
287290
end;

0 commit comments

Comments
 (0)