Skip to content

Commit 53d71df

Browse files
committed
Revert "Use new supervisor2:prep_stop to stop rabbit dependencies on shutdown"
This reverts commit dcf15e7. Unnecessary when making rabbit application transient rabbitmq-server-1216 [#145106709]
1 parent b25935c commit 53d71df

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

src/rabbit_sup.erl

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
-module(rabbit_sup).
1818

19-
-behaviour(supervisor2).
19+
-behaviour(supervisor).
2020

2121
-export([start_link/0, start_child/1, start_child/2, start_child/3, start_child/4,
2222
start_supervisor_child/1, start_supervisor_child/2,
@@ -25,7 +25,7 @@
2525
start_delayed_restartable_child/1, start_delayed_restartable_child/2,
2626
stop_child/1]).
2727

28-
-export([init/1, prep_stop/0]).
28+
-export([init/1]).
2929

3030
-include("rabbit.hrl").
3131

@@ -49,20 +49,20 @@
4949

5050
%%----------------------------------------------------------------------------
5151

52-
start_link() -> supervisor2:start_link({local, ?SERVER}, ?MODULE, []).
52+
start_link() -> supervisor:start_link({local, ?SERVER}, ?MODULE, []).
5353

5454
start_child(Mod) -> start_child(Mod, []).
5555

5656
start_child(Mod, Args) -> start_child(Mod, Mod, Args).
5757

5858
start_child(ChildId, Mod, Args) ->
59-
child_reply(supervisor2:start_child(
59+
child_reply(supervisor:start_child(
6060
?SERVER,
6161
{ChildId, {Mod, start_link, Args},
6262
transient, ?WORKER_WAIT, worker, [Mod]})).
6363

6464
start_child(ChildId, Mod, Fun, Args) ->
65-
child_reply(supervisor2:start_child(
65+
child_reply(supervisor:start_child(
6666
?SERVER,
6767
{ChildId, {Mod, Fun, Args},
6868
transient, ?WORKER_WAIT, worker, [Mod]})).
@@ -73,7 +73,7 @@ start_supervisor_child(Mod) -> start_supervisor_child(Mod, []).
7373
start_supervisor_child(Mod, Args) -> start_supervisor_child(Mod, Mod, Args).
7474

7575
start_supervisor_child(ChildId, Mod, Args) ->
76-
child_reply(supervisor2:start_child(
76+
child_reply(supervisor:start_child(
7777
?SERVER,
7878
{ChildId, {Mod, start_link, Args},
7979
transient, infinity, supervisor, [Mod]})).
@@ -85,25 +85,20 @@ start_delayed_restartable_child(M, A) -> start_restartable_child(M, A, true).
8585

8686
start_restartable_child(Mod, Args, Delay) ->
8787
Name = list_to_atom(atom_to_list(Mod) ++ "_sup"),
88-
child_reply(supervisor2:start_child(
88+
child_reply(supervisor:start_child(
8989
?SERVER,
9090
{Name, {rabbit_restartable_sup, start_link,
9191
[Name, {Mod, start_link, Args}, Delay]},
9292
transient, infinity, supervisor, [rabbit_restartable_sup]})).
9393

9494
stop_child(ChildId) ->
95-
case supervisor2:terminate_child(?SERVER, ChildId) of
96-
ok -> supervisor2:delete_child(?SERVER, ChildId);
95+
case supervisor:terminate_child(?SERVER, ChildId) of
96+
ok -> supervisor:delete_child(?SERVER, ChildId);
9797
E -> E
9898
end.
9999

100100
init([]) -> {ok, {{one_for_all, 0, 1}, []}}.
101101

102-
prep_stop() ->
103-
rabbit_log:info("Stopping dependencies...~n",[]),
104-
Apps = rabbit_plugins:active(),
105-
rabbit:stop_apps(app_utils:app_dependency_order(Apps, true)),
106-
rabbit_log:info("Dependencies stopped...~n",[]).
107102

108103
%%----------------------------------------------------------------------------
109104

0 commit comments

Comments
 (0)