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

[05/22] couch-mrview commit: updated refs/heads/1963-eunit-bigcouch to cc9c436

Don't use delayed send when a resp hasn't started

This is for a bit of an edge condition if we get an error before we
start streaming data through the coordinator. Easily triggered by
setting all copies of a shard to maintenance mode.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/commit/ad72dc84
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/tree/ad72dc84
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/diff/ad72dc84

Branch: refs/heads/1963-eunit-bigcouch
Commit: ad72dc84be02f4ce41a837aa7630b385384d37d8
Parents: cd338d6
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Aug 14 12:50:06 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Aug 19 11:48:28 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/ad72dc84/src/couch_mrview_http.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview_http.erl b/src/couch_mrview_http.erl
index 1965aa3..4c7355d 100644
--- a/src/couch_mrview_http.erl
+++ b/src/couch_mrview_http.erl
@@ -287,6 +287,9 @@ view_cb(complete, #vacc{resp=Resp}=Acc) ->
         _ ->
             {ok, Acc#vacc{resp=Resp1, prepend=",\r\n"}}
     end;
+view_cb({error, Reason}, #vacc{resp=undefined}=Acc) ->
+    {ok, Resp} = chttpd:send_error(Acc#vacc.req, Reason),
+    {ok, Acc#vacc{resp=Resp}};
 view_cb({error, Reason}, #vacc{resp=Resp}=Acc) ->
     {ok, Resp1} = chttpd:send_delayed_error(Resp, Reason),
     {ok, Acc#vacc{resp=Resp1}}.