From a2da4ef5d16f3e9e3f239ed85351ebe527daa9d1 Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Mon, 3 Oct 2011 21:02:44 -0500 Subject: [PATCH] Fix the changes feed. The handling of timeout messages in fabric_view_changes:handle_message/3 was incorrectly discarding updates to the state. This means that we could accidentally discard things like the handling of rexi_EXIT messages which would then later lead to an infinite wait in rexi_utils:recv/6 because we forgot that the node died. BugzID: 12706 --- src/fabric_view_changes.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fabric_view_changes.erl b/src/fabric_view_changes.erl index 353cbdd..764e854 100644 --- a/src/fabric_view_changes.erl +++ b/src/fabric_view_changes.erl @@ -130,9 +130,9 @@ send_changes(DbName, ChangesArgs, Callback, PackedSeqs, AccIn, Timeout) -> receive_results(Workers, State, Timeout, Callback, AccIn) -> case rexi_utils:recv(Workers, #shard.ref, fun handle_message/3, State, infinity, Timeout) of - {timeout, _NewState} -> + {timeout, NewState0} -> {ok, AccOut} = Callback(timeout, AccIn), - NewState = State#collector{user_acc = AccOut}, + NewState = NewState0#collector{user_acc = AccOut}, receive_results(Workers, NewState, Timeout, Callback, AccOut); {_, NewState} -> {ok, NewState}