diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2014-04-13 19:22:01 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2014-04-13 19:22:01 +0100 |
commit | 81986c4e315d9e58dad74a470b262ba7feb84b37 (patch) | |
tree | bb73a9270e83fd734c02d58c86b5c90ec4f22fb4 | |
parent | f168a0ba576b494bfef739b4c0b995ebf3b29418 (diff) | |
download | rabbitmq-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.erl | 30 |
1 files changed, 9 insertions, 21 deletions
@@ -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. |