summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiana Corbacho <diana@rabbitmq.com>2016-09-20 11:15:52 +0100
committerDiana Corbacho <diana@rabbitmq.com>2016-09-20 12:32:38 +0100
commitd5e11bc481154b1534c00a04d0e32a314dec7ddd (patch)
treeb027c1a93041bce050b414e51a24d09ed441590f /src
parent1cdef63c2fbdc547b725e89ca3efbfed766956d5 (diff)
downloadrabbitmq-server-git-d5e11bc481154b1534c00a04d0e32a314dec7ddd.tar.gz
Stop in request_depth if master is not a member any longer
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_mirror_queue_coordinator.erl12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/rabbit_mirror_queue_coordinator.erl b/src/rabbit_mirror_queue_coordinator.erl
index fe1168f120..562f0f0fcf 100644
--- a/src/rabbit_mirror_queue_coordinator.erl
+++ b/src/rabbit_mirror_queue_coordinator.erl
@@ -368,9 +368,15 @@ handle_cast({gm_deaths, DeadGMPids},
{stop, normal, State}
end;
-handle_cast(request_depth, State = #state { depth_fun = DepthFun }) ->
- ok = DepthFun(),
- noreply(State);
+handle_cast(request_depth, State = #state { depth_fun = DepthFun,
+ q = #amqqueue { name = QName, pid = MPid }}) ->
+ case rabbit_amqqueue:lookup(QName) of
+ {ok, #amqqueue{ pid = MPid }} ->
+ ok = DepthFun(),
+ noreply(State);
+ _ ->
+ {stop, shutdown, State}
+ end;
handle_cast({ensure_monitoring, Pids}, State = #state { monitors = Mons }) ->
noreply(State #state { monitors = pmon:monitor_all(Pids, Mons) });