summaryrefslogtreecommitdiff
path: root/src/rabbit_connection_sup.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rabbit_connection_sup.erl')
-rw-r--r--src/rabbit_connection_sup.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rabbit_connection_sup.erl b/src/rabbit_connection_sup.erl
index 94891629..fee377e7 100644
--- a/src/rabbit_connection_sup.erl
+++ b/src/rabbit_connection_sup.erl
@@ -42,11 +42,20 @@ start_link() ->
SupPid,
{collector, {rabbit_queue_collector, start_link, []},
intrinsic, ?MAX_WAIT, worker, [rabbit_queue_collector]}),
+ %% We need to get channels in the hierarchy here so they close
+ %% before the reader. But for 1.0 readers we can't start the real
+ %% ch_sup_sup (because we don't know if we will be 0-9-1 or 1.0) -
+ %% so we add another supervisor into the hierarchy.
+ {ok, ChannelSup3Pid} =
+ supervisor2:start_child(
+ SupPid,
+ {channel_sup3, {rabbit_intermediate_sup, start_link, []},
+ intrinsic, infinity, supervisor, [rabbit_intermediate_sup]}),
{ok, ReaderPid} =
supervisor2:start_child(
SupPid,
{reader, {rabbit_reader, start_link,
- [SupPid, Collector,
+ [ChannelSup3Pid, Collector,
rabbit_heartbeat:start_heartbeat_fun(SupPid)]},
intrinsic, ?MAX_WAIT, worker, [rabbit_reader]}),
{ok, SupPid, ReaderPid}.