couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject rexi commit: updated refs/heads/windsor-merge to 535941d
Date Thu, 07 Aug 2014 11:33:22 GMT
Repository: couchdb-rexi
Updated Branches:
  refs/heads/windsor-merge 096f0cfb1 -> 535941d94


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/windsor-merge
Commit: 535941d94d3e2d05f5ec31d2ff8f65c4149cc1da
Parents: 096f0cf
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Fri Jul 18 14:58:23 2014 -0400
Committer: Robert Newson <rnewson@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}.


Mime
View raw message