summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2014-04-13 19:22:01 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2014-04-13 19:22:01 +0100
commit56f423fcbe7c9a67a92de2a86cfdee02bb29e927 (patch)
treebb73a9270e83fd734c02d58c86b5c90ec4f22fb4
parent6f560a10337d8a066f460d5c044380b25bfb2473 (diff)
downloadrabbitmq-server-git-56f423fcbe7c9a67a92de2a86cfdee02bb29e927.tar.gz
less lazy death notifications
When we receive a DOWN, it's possible that there are no messages from the dead member floating around anyway. So rather than waiting for some other activity to occur first, it is perfectly safe enough to always call maybe_erase_aliases. That way we get slightly less lazy death notification in this case (i.e. we can then be certain that either the dead member is fully removed immediately or there must still be messages from the dead member floating around. No other possibility exists).
-rw-r--r--src/gm.erl30
1 files changed, 9 insertions, 21 deletions
diff --git a/src/gm.erl b/src/gm.erl
index c9ae9ced24..2ed2fcf17c 100644
--- a/src/gm.erl
+++ b/src/gm.erl
@@ -706,9 +706,6 @@ handle_info({'DOWN', MRef, process, _Pid, Reason},
left = Left,
right = Right,
group_name = GroupName,
- view = View,
- module = Module,
- callback_args = Args,
confirms = Confirms,
txn_executor = TxnFun }) ->
Member = case {Left, Right} of
@@ -722,24 +719,15 @@ handle_info({'DOWN', MRef, process, _Pid, Reason},
{_, {shutdown, ring_shutdown}} ->
noreply(State);
_ ->
- View1 =
- group_to_view(record_dead_member_in_group(Member,
- GroupName, TxnFun)),
- {Result, State2} =
- case alive_view_members(View1) of
- [Self] ->
- {Result1, State1} = maybe_erase_aliases(State, View1),
- {Result1, State1 #state {
- members_state = blank_member_state(),
- confirms = purge_confirms(Confirms) }};
- _ ->
- %% here we won't be pointing out any deaths:
- %% the concern is that there maybe births
- %% which we'd otherwise miss.
- {callback_view_changed(Args, Module, View, View1),
- check_neighbours(State #state { view = View1 })}
- end,
- handle_callback_result({Result, State2})
+ View1 = group_to_view(record_dead_member_in_group(
+ Member, GroupName, TxnFun)),
+ State1 = case alive_view_members(View1) of
+ [Self] -> State #state {
+ members_state = blank_member_state(),
+ confirms = purge_confirms(Confirms) };
+ _ -> State
+ end,
+ handle_callback_result(maybe_erase_aliases(State1, View1))
end.