diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_cli.erl | 4 | ||||
| -rw-r--r-- | src/rabbit_control_main.erl | 11 |
3 files changed, 12 insertions, 5 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 033379bad1..4a9ae6ba76 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -453,7 +453,7 @@ stop_and_halt() -> stop() catch Type:Reason -> rabbit_log:error("Error trying to stop RabbitMQ: ~p:~p", [Type, Reason]), - error({Type, Reason}) + erlang:error({Type, Reason}) after %% Enclose all the logging in the try block. %% init:stop() will be called regardless of any errors. diff --git a/src/rabbit_cli.erl b/src/rabbit_cli.erl index da29136853..c4c7b8eaeb 100644 --- a/src/rabbit_cli.erl +++ b/src/rabbit_cli.erl @@ -93,6 +93,10 @@ main(ParseFun, DoFun, UsageMod) -> {'EXIT', {function_clause, [{?MODULE, action, _, _} | _]}} -> %% >= R15 PrintInvalidCommandError(), usage(UsageMod); + {error, {error_during_shutdown, Err}} -> + print_error("Node ~w failed to shut down: ~p.", + [Node, Err]), + rabbit_misc:quit(?EX_SHUTDOWN_ERROR); {error, {missing_dependencies, Missing, Blame}} -> print_error("dependent plugins ~p not found; used by ~p.", [Missing, Blame]), diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl index 50cf832e5d..d220ab3802 100644 --- a/src/rabbit_control_main.erl +++ b/src/rabbit_control_main.erl @@ -283,10 +283,13 @@ shutdown_node_and_wait_pid_to_stop(Node, Pid, Inform) -> wait_for_process_death(Pid), Inform( "RabbitMQ node ~p running at PID ~s successfully shut down", - [Node, Pid]); - _ -> ok - end, - Res. + [Node, Pid]), + Res; + {error, Err} -> + {error, {error_during_shutdown, Err}}; + _ -> + Res + end. action(shutdown, Node, [], _Opts, Inform) -> case rpc:call(Node, os, getpid, []) of |
