summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2017-03-09 10:11:19 +0300
committerMichael Klishin <mklishin@pivotal.io>2017-03-09 10:15:00 +0300
commit4527efd8f6ad129b7010c4122a211811d97794aa (patch)
treee0e87eeaa32647a2daa4f2e0561b5b5bb157fd69
parentfcf04fbdf6d3f943254a1431f0d1e4c2d1745e17 (diff)
parentb40bf8c99dbd1352e0bc04d5cff79ab81d77e786 (diff)
downloadrabbitmq-server-git-4527efd8f6ad129b7010c4122a211811d97794aa.tar.gz
Merge branch 'stable'
Conflicts: src/rabbit_msg_store.erl test/partitions_SUITE.erl
-rw-r--r--src/rabbit.erl20
-rw-r--r--src/rabbit_msg_store.erl5
-rw-r--r--test/partitions_SUITE.erl12
3 files changed, 24 insertions, 13 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl
index e5ae855982..a0c66f1cec 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -465,18 +465,26 @@ start_it(StartFun) ->
stop() ->
case whereis(rabbit_boot) of
undefined -> ok;
- _ -> await_startup(true)
+ _ ->
+ rabbit_log:info("RabbitMQ hasn't finished starting yet. Waiting for startup to finish before stopping..."),
+ await_startup(true)
end,
- rabbit_log:info("Stopping RabbitMQ~n", []),
+ rabbit_log:info("RabbitMQ is asked to stop...~n", []),
Apps = ?APPS ++ rabbit_plugins:active(),
stop_apps(app_utils:app_dependency_order(Apps, true)),
- rabbit_log:info("Stopped RabbitMQ application~n", []).
+ rabbit_log:info("Successfully stopped RabbitMQ and its dependencies~n", []).
stop_and_halt() ->
try
stop()
+ catch Type:Reason ->
+ rabbit_log:error("Error trying to stop RabbitMQ: ~p:~p", [Type, Reason])
after
- rabbit_log:info("Halting Erlang VM~n", []),
+ AppsLeft = [ A || {A, _, _} <- application:which_applications() ],
+ rabbit_log:info(
+ lists:flatten(["Halting Erlang VM with the following applications:~n",
+ [" ~p~n" || _ <- AppsLeft]]),
+ AppsLeft),
%% Also duplicate this information to stderr, so console where
%% foreground broker was running (or systemd journal) will
%% contain information about graceful termination.
@@ -600,6 +608,10 @@ decrypt_list([Value|Tail], Algo, Acc) ->
decrypt_list(Tail, Algo, [decrypt(Value, Algo)|Acc]).
stop_apps(Apps) ->
+ rabbit_log:info(
+ lists:flatten(["Stopping RabbitMQ applications and their dependencies in the following order: ~n",
+ [" ~p~n" || _ <- Apps]]),
+ lists:reverse(Apps)),
ok = app_utils:stop_applications(
Apps, handle_app_error(error_during_shutdown)),
case lists:member(rabbit, Apps) of
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl
index 6b16c7eabf..979de7b6ee 100644
--- a/src/rabbit_msg_store.erl
+++ b/src/rabbit_msg_store.erl
@@ -981,6 +981,7 @@ terminate(_Reason, State = #msstate { index_state = IndexState,
flying_ets = FlyingEts,
clients = Clients,
dir = Dir }) ->
+ rabbit_log:info("Stopping message store for directory '~s'", [Dir]),
%% stop the gc first, otherwise it could be working and we pull
%% out the ets tables from under it.
ok = rabbit_msg_store_gc:stop(GCPid),
@@ -1004,7 +1005,9 @@ terminate(_Reason, State = #msstate { index_state = IndexState,
IndexModule:terminate(IndexState),
case store_recovery_terms([{client_refs, dict:fetch_keys(Clients)},
{index_module, IndexModule}], Dir) of
- ok -> ok;
+ ok ->
+ rabbit_log:info("Message store for directory '~s' is stopped", [Dir]),
+ ok;
{error, RTErr} ->
rabbit_log:error("Unable to save message store recovery terms"
"for directory ~p~nError: ~p~n",
diff --git a/test/partitions_SUITE.erl b/test/partitions_SUITE.erl
index 3f0ec419c2..8c8a772987 100644
--- a/test/partitions_SUITE.erl
+++ b/test/partitions_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2011-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2011-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(partitions_SUITE).
@@ -21,10 +21,6 @@
-compile(export_all).
--import(rabbit_ct_broker_helpers, [enable_dist_proxy_manager/1,
- enable_dist_proxy/1,
- enable_dist_proxy_on_node/3]).
-
%% We set ticktime to 1s and setuptime is 7s so to make sure it
%% passes...
-define(DELAY, 8000).
@@ -34,7 +30,7 @@
-define(AWAIT_TIMEOUT, 300000).
suite() ->
- [{timetrap, {minutes, 60}}].
+ [{timetrap, 5 * 60000}].
all() ->
[
@@ -52,8 +48,8 @@ groups() ->
{cluster_size_3, [], [
autoheal,
autoheal_after_pause_if_all_down,
- autoheal_multiple_partial_partitions,
- autoheal_unexpected_finish,
+ autoheal_multiple_partial_partitions,
+ autoheal_unexpected_finish,
ignore,
pause_if_all_down_on_blocked,
pause_if_all_down_on_down,