summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-04-11 11:36:15 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-04-11 11:36:15 +0100
commitb1c206bbf80b790335287178418f02381cd84f12 (patch)
tree2c87aa4a65f9d0870e877527446d8b08071dffa7
parent132008e2f469c9eb89ba16c307909e75ce5593cc (diff)
downloadrabbitmq-server-b1c206bbf80b790335287178418f02381cd84f12.tar.gz
Actually let's move the unlink/1 back, not convinced it is any clearer.bug26102
-rw-r--r--src/rabbit_mirror_queue_master.erl9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rabbit_mirror_queue_master.erl b/src/rabbit_mirror_queue_master.erl
index 7a08bee4..2b16b911 100644
--- a/src/rabbit_mirror_queue_master.erl
+++ b/src/rabbit_mirror_queue_master.erl
@@ -126,8 +126,10 @@ init_with_existing_bq(Q = #amqqueue{name = QName}, BQ, BQS) ->
confirmed = [],
known_senders = sets:new() }.
-stop_mirroring(State = #state { backing_queue = BQ,
+stop_mirroring(State = #state { coordinator = CPid,
+ backing_queue = BQ,
backing_queue_state = BQS }) ->
+ unlink(CPid),
stop_all_slaves(shutdown, State),
{BQ, BQS}.
@@ -179,11 +181,8 @@ delete_and_terminate(Reason, State = #state { backing_queue = BQ,
stop_all_slaves(Reason, State),
State#state{backing_queue_state = BQ:delete_and_terminate(Reason, BQS)}.
-stop_all_slaves(Reason, #state{name = QName,
- gm = GM,
- coordinator = CPid}) ->
+stop_all_slaves(Reason, #state{name = QName, gm = GM}) ->
{ok, #amqqueue{slave_pids = SPids}} = rabbit_amqqueue:lookup(QName),
- unlink(CPid),
MRefs = [erlang:monitor(process, Pid) || Pid <- [GM | SPids]],
ok = gm:broadcast(GM, {delete_and_terminate, Reason}),
[receive {'DOWN', MRef, process, _Pid, _Info} -> ok end || MRef <- MRefs],