summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Fedotov <dfedotov@pivotal.io>2016-09-26 13:06:17 +0100
committerDaniil Fedotov <dfedotov@pivotal.io>2016-09-26 13:06:17 +0100
commit1ef16ba0c52e450ae620a9545db6178672590128 (patch)
treec53952f08dc96f735064259511b10df00e18a8a4 /src
parent6a27cb5fb1dfecfdaf875842b50b1a2c6dc3a924 (diff)
downloadrabbitmq-server-git-1ef16ba0c52e450ae620a9545db6178672590128.tar.gz
Stop syncer if there is no slaves to sync to
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