diff options
| author | Diana Corbacho <diana@rabbitmq.com> | 2017-05-11 09:54:34 +0100 |
|---|---|---|
| committer | Diana Corbacho <diana@rabbitmq.com> | 2017-05-11 09:56:35 +0100 |
| commit | 53d71dfa948ce0db940c8a72e7d5e18c64b2a024 (patch) | |
| tree | 770c732f9713f281e89415bb0d93a55957f425e0 /src | |
| parent | b25935c1ac0ccbc178e4df909c3945b040a8f7db (diff) | |
| download | rabbitmq-server-git-53d71dfa948ce0db940c8a72e7d5e18c64b2a024.tar.gz | |
Revert "Use new supervisor2:prep_stop to stop rabbit dependencies on shutdown"
This reverts commit dcf15e7d894e536cc09bc065310d97fcee6c7d12.
Unnecessary when making rabbit application transient
rabbitmq-server-1216
[#145106709]
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_sup.erl | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/rabbit_sup.erl b/src/rabbit_sup.erl index 0622d16e61..38d561fa80 100644 --- a/src/rabbit_sup.erl +++ b/src/rabbit_sup.erl @@ -16,7 +16,7 @@ -module(rabbit_sup). --behaviour(supervisor2). +-behaviour(supervisor). -export([start_link/0, start_child/1, start_child/2, start_child/3, start_child/4, start_supervisor_child/1, start_supervisor_child/2, @@ -25,7 +25,7 @@ start_delayed_restartable_child/1, start_delayed_restartable_child/2, stop_child/1]). --export([init/1, prep_stop/0]). +-export([init/1]). -include("rabbit.hrl"). @@ -49,20 +49,20 @@ %%---------------------------------------------------------------------------- -start_link() -> supervisor2:start_link({local, ?SERVER}, ?MODULE, []). +start_link() -> supervisor:start_link({local, ?SERVER}, ?MODULE, []). start_child(Mod) -> start_child(Mod, []). start_child(Mod, Args) -> start_child(Mod, Mod, Args). start_child(ChildId, Mod, Args) -> - child_reply(supervisor2:start_child( + child_reply(supervisor:start_child( ?SERVER, {ChildId, {Mod, start_link, Args}, transient, ?WORKER_WAIT, worker, [Mod]})). start_child(ChildId, Mod, Fun, Args) -> - child_reply(supervisor2:start_child( + child_reply(supervisor:start_child( ?SERVER, {ChildId, {Mod, Fun, Args}, transient, ?WORKER_WAIT, worker, [Mod]})). @@ -73,7 +73,7 @@ start_supervisor_child(Mod) -> start_supervisor_child(Mod, []). start_supervisor_child(Mod, Args) -> start_supervisor_child(Mod, Mod, Args). start_supervisor_child(ChildId, Mod, Args) -> - child_reply(supervisor2:start_child( + child_reply(supervisor:start_child( ?SERVER, {ChildId, {Mod, start_link, Args}, transient, infinity, supervisor, [Mod]})). @@ -85,25 +85,20 @@ start_delayed_restartable_child(M, A) -> start_restartable_child(M, A, true). start_restartable_child(Mod, Args, Delay) -> Name = list_to_atom(atom_to_list(Mod) ++ "_sup"), - child_reply(supervisor2:start_child( + child_reply(supervisor:start_child( ?SERVER, {Name, {rabbit_restartable_sup, start_link, [Name, {Mod, start_link, Args}, Delay]}, transient, infinity, supervisor, [rabbit_restartable_sup]})). stop_child(ChildId) -> - case supervisor2:terminate_child(?SERVER, ChildId) of - ok -> supervisor2:delete_child(?SERVER, ChildId); + case supervisor:terminate_child(?SERVER, ChildId) of + ok -> supervisor:delete_child(?SERVER, ChildId); E -> E end. init([]) -> {ok, {{one_for_all, 0, 1}, []}}. -prep_stop() -> - rabbit_log:info("Stopping dependencies...~n",[]), - Apps = rabbit_plugins:active(), - rabbit:stop_apps(app_utils:app_dependency_order(Apps, true)), - rabbit_log:info("Dependencies stopped...~n",[]). %%---------------------------------------------------------------------------- |
