summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2016-09-29 10:58:53 +0300
committerMichael Klishin <michael@clojurewerkz.org>2016-09-29 10:58:53 +0300
commit32b6cb838105fe4efa56aad3d1496ec870f7d217 (patch)
treebb95cfeaaa8c2b2090aabf8da81d62100f498bfe /src
parent1215682ac2896ddafee14ba4ea2ed6811882e5f9 (diff)
parentd0359ac82ce8c3a8868800963c9163afe91456b6 (diff)
downloadrabbitmq-server-git-32b6cb838105fe4efa56aad3d1496ec870f7d217.tar.gz
Merge branch 'stable' into rabbitmq-server-973
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_mirror_queue_sync.erl12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/rabbit_mirror_queue_sync.erl b/src/rabbit_mirror_queue_sync.erl
index 54f0855fce..c438e91a3f 100644
--- a/src/rabbit_mirror_queue_sync.erl
+++ b/src/rabbit_mirror_queue_sync.erl
@@ -248,9 +248,15 @@ syncer_loop(Ref, MPid, SPids) ->
syncer_loop(Ref, MPid, SPids);
{msgs, Ref, Msgs} ->
SPids1 = wait_for_credit(SPids),
- broadcast(SPids1, {sync_msgs, Ref, Msgs}),
- MPid ! {next, Ref},
- syncer_loop(Ref, MPid, SPids1);
+ case SPids1 of
+ [] ->
+ % Die silently because there are no slaves left.
+ ok;
+ _ ->
+ broadcast(SPids1, {sync_msgs, Ref, Msgs}),
+ MPid ! {next, Ref},
+ syncer_loop(Ref, MPid, SPids1)
+ end;
{cancel, Ref} ->
%% We don't tell the slaves we will die - so when we do
%% they interpret that as a failure, which is what we