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
commit81986c4e315d9e58dad74a470b262ba7feb84b37 (patch)
treebb73a9270e83fd734c02d58c86b5c90ec4f22fb4
parentf168a0ba576b494bfef739b4c0b995ebf3b29418 (diff)
downloadrabbitmq-server-81986c4e315d9e58dad74a470b262ba7feb84b37.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 c9ae9ced..2ed2fcf1 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.