summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2017-07-04 19:00:11 +0300
committerMichael Klishin <mklishin@pivotal.io>2017-07-04 19:00:11 +0300
commita6cae1a2e9bc762f651b9a5ddc21f64f366244d2 (patch)
tree53a599c2202e306075cfb11a6969440a3ca2ba46 /src
parentb9cc246f1d08f1f43943b1f51a16b793b05fef61 (diff)
downloadrabbitmq-server-git-a6cae1a2e9bc762f651b9a5ddc21f64f366244d2.tar.gz
Terminate when message stores fail to start
This makes rabbit.vhost_restart_strategy work as expected: higher up supervisors should decide whether the node should stop or keep going. Per discussion with @hairyhum.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_variable_queue.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index 7c631ddc66..4dfa6b69ac 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -504,12 +504,14 @@ safely_start_msg_store(VHost, Type, Refs, StartFunState) ->
case rabbit_vhost_msg_store:start(VHost, Type, Refs, StartFunState) of
{ok, _} ->
rabbit_log:info("Started message store of type ~s for vhost '~s'~n", [abbreviated_type(Type), VHost]);
- {error, {no_such_vhost, VHost}} ->
+ {error, {no_such_vhost, VHost}} = Err ->
rabbit_log:error("Failed to start message store of type ~s for vhost '~s': the vhost no longer exists!~n",
- [Type, VHost]);
+ [Type, VHost]),
+ exit(Err);
{error, Error} ->
rabbit_log:error("Failed to start message store of type ~s for vhost '~s': ~p~n",
- [Type, VHost, Error])
+ [Type, VHost, Error]),
+ exit({error, Error})
end.
abbreviated_type(?TRANSIENT_MSG_STORE) -> transient;