Skip to content

Commit d38886e

Browse files
committed
Merge pull request #2439 from rabbitmq/rabbitmq-mqtt-revert-233-changes
Revert "tcp_listener_sup: use maps for supervisor flags and child spec" (cherry picked from commit 32b0c21)
1 parent aafaa60 commit d38886e

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

src/rabbit_networking.erl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,9 @@ tcp_listener_spec(NamePrefix, {IPAddress, Port, Family}, SocketOpts,
184184
{?MODULE, tcp_listener_started, [Protocol, SocketOpts]},
185185
{?MODULE, tcp_listener_stopped, [Protocol, SocketOpts]},
186186
NumAcceptors, Label],
187-
#{
188-
id => rabbit_misc:tcp_name(NamePrefix, IPAddress, Port),
189-
start => {tcp_listener_sup, start_link, Args},
190-
restart => transient,
191-
shutdown => infinity,
192-
type => supervisor,
193-
modules => [tcp_listener_sup]
194-
}.
187+
{rabbit_misc:tcp_name(NamePrefix, IPAddress, Port),
188+
{tcp_listener_sup, start_link, Args},
189+
transient, infinity, supervisor, [tcp_listener_sup]}.
195190

196191
-spec ranch_ref(#listener{} | [{atom(), any()}] | 'undefined') -> ranch:ref() | undefined.
197192
ranch_ref(#listener{port = Port}) ->

src/tcp_listener_sup.erl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,9 @@ init({IPAddress, Port, Transport, SocketOpts, ProtoSup, ProtoOpts, OnStartup, On
4545
{port, Port} |
4646
SocketOpts]
4747
},
48-
Flags = #{strategy => one_for_all, intensity => 10, period => 10},
49-
OurChildSpec = #{
50-
id => tcp_listener,
51-
start => {tcp_listener, start_link, [IPAddress, Port, OnStartup, OnShutdown, Label]},
52-
restart => transient,
53-
shutdown => 16#ffffffff,
54-
type => worker,
55-
modules => [tcp_listener]
56-
},
48+
Flags = {one_for_all, 10, 10},
49+
OurChildSpecStart = {tcp_listener, start_link, [IPAddress, Port, OnStartup, OnShutdown, Label]},
50+
OurChildSpec = {tcp_listener, OurChildSpecStart, transient, 16#ffffffff, worker, [tcp_listener]},
5751
RanchChildSpec = ranch:child_spec(rabbit_networking:ranch_ref(IPAddress, Port),
5852
Transport, RanchListenerOpts,
5953
ProtoSup, ProtoOpts),

0 commit comments

Comments
 (0)