You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/08/28 14:23:38 UTC

[28/33] rexi commit: updated refs/heads/master to bbf59a2

Allow for timeout message while waiting for sender

In 9c36c1b0 we fixed counting bug in the bufffer but introduced another
one. We started asserting that the timeout message can only arrive when
the sender is not nil, but in fact it can absolutely happen that the
buffer is asked to deliver a message while one is in flight. This causes
the rexi_buffer to crash. The fix is to simply restore the clause that
ignores the timeout message if the server is waiting for a sender to
return.

BugzID: 32669


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rexi/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rexi/commit/535941d9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rexi/tree/535941d9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rexi/diff/535941d9

Branch: refs/heads/master
Commit: 535941d94d3e2d05f5ec31d2ff8f65c4149cc1da
Parents: 096f0cf
Author: Adam Kocoloski <ad...@cloudant.com>
Authored: Fri Jul 18 14:58:23 2014 -0400
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Aug 7 12:33:09 2014 +0100

----------------------------------------------------------------------
 src/rexi_buffer.erl | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rexi/blob/535941d9/src/rexi_buffer.erl
----------------------------------------------------------------------
diff --git a/src/rexi_buffer.erl b/src/rexi_buffer.erl
index 42b4ef2..0ba961a 100644
--- a/src/rexi_buffer.erl
+++ b/src/rexi_buffer.erl
@@ -78,6 +78,9 @@ handle_info(timeout, #state{sender = nil, count = C} = State) when C > 0 ->
             Sender = spawn_monitor(erlang, send, [Dest, Msg]),
             {noreply, NewState#state{sender = Sender}}
     end;
+handle_info(timeout, State) ->
+    % Waiting on a sender to return
+    {noreply, State};
 
 handle_info({'DOWN', Ref, _, Pid, _}, #state{sender = {Pid, Ref}} = State) ->
     {noreply, State#state{sender = nil}, 0}.