diff options
| author | Luke Bakken <lbakken@pivotal.io> | 2017-10-24 17:16:46 -0700 |
|---|---|---|
| committer | Luke Bakken <lbakken@pivotal.io> | 2017-10-24 17:16:46 -0700 |
| commit | a05d60f2cd93c94f0f0d9376ff3c25f34f82b62a (patch) | |
| tree | 30cca4f68b19a68d042619b307fe816b58eae26e /src | |
| parent | b55f79da5fd50ead74308d8ad3bcf7121dac38c4 (diff) | |
| download | rabbitmq-server-git-a05d60f2cd93c94f0f0d9376ff3c25f34f82b62a.tar.gz | |
Trigger error in shutdown
Added an exit() statement to trigger an error and then some case statements to handle it.
QA of commit 51aca8851eba66445ad5b164fc92b2ffa0692fc2
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 3 | ||||
| -rw-r--r-- | src/rabbit_control_main.erl | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 4a9ae6ba76..8e3601da3b 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -450,7 +450,8 @@ stop() -> stop_and_halt() -> try - stop() + stop(), + exit(whoops_something_went_wrong) %% TODO REMOVE THIS QA ONLY catch Type:Reason -> rabbit_log:error("Error trying to stop RabbitMQ: ~p:~p", [Type, Reason]), erlang:error({Type, Reason}) diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl index d220ab3802..c30c9b8f45 100644 --- a/src/rabbit_control_main.erl +++ b/src/rabbit_control_main.erl @@ -285,8 +285,8 @@ shutdown_node_and_wait_pid_to_stop(Node, Pid, Inform) -> "RabbitMQ node ~p running at PID ~s successfully shut down", [Node, Pid]), Res; - {error, Err} -> - {error, {error_during_shutdown, Err}}; + {badrpc, {'EXIT', RpcErr}} -> + {error, {error_during_shutdown, RpcErr}}; _ -> Res end. @@ -295,6 +295,8 @@ action(shutdown, Node, [], _Opts, Inform) -> case rpc:call(Node, os, getpid, []) of Pid when is_list(Pid) -> shutdown_node_and_wait_pid_to_stop(Node, Pid, Inform); + {badrpc, {'EXIT', RpcErr}} -> + {error, {error_during_shutdown, RpcErr}}; Error -> Error end; |
