From dev-return-7053-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Sat Oct 31 20:23:14 2009 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 73985 invoked from network); 31 Oct 2009 20:23:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Oct 2009 20:23:13 -0000 Received: (qmail 57986 invoked by uid 500); 31 Oct 2009 20:23:13 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 57900 invoked by uid 500); 31 Oct 2009 20:23:12 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 57889 invoked by uid 99); 31 Oct 2009 20:23:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Oct 2009 20:23:12 +0000 X-ASF-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.211.186 as permitted sender) Received: from [209.85.211.186] (HELO mail-yw0-f186.google.com) (209.85.211.186) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Oct 2009 20:23:09 +0000 Received: by ywh16 with SMTP id 16so3844948ywh.13 for ; Sat, 31 Oct 2009 13:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=lG4vG8fNfIWkGBlQx5dGMIZpx1JL+SCw4zRVJNNnGS8=; b=auARpb2I3NyyJoMC7N2JfX55hfqN81z1CK3iyj5jmKSXrOgx4NmfnjSAeakMZ0KMk8 tco0cY1asu6F0LR1sF9KJRX3ErxHmHZT/1QbmIRPUL9AUv/1bfLnuRArn/N7cWSoIa0+ 9vQK6sEvb8TR2N+lw1KUIYAZUzYF0s3mHPHuY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=XvqIk6CmmY5GG4j49yhyhjSmehve26y0MKXlW+ZaKCSR2KEOp/3ahy+vwCoe8TVziS 7pRZmye3SCaPqJdhvoXnf1qrnSAcg6ZtCa6zn+sOvog5ZTsn6bV3lOEaIMc+pxgQzsjl ZguumeZNxHXgraXchEVUspiHdLr6M0bSlTKrk= MIME-Version: 1.0 Received: by 10.101.179.1 with SMTP id g1mr2547937anp.13.1257020565106; Sat, 31 Oct 2009 13:22:45 -0700 (PDT) In-Reply-To: <087B524B-81BD-49E4-B093-B0C4D5A45A74@apache.org> References: <20091031011705.0BF2323888DD@eris.apache.org> <087B524B-81BD-49E4-B093-B0C4D5A45A74@apache.org> From: Paul Davis Date: Sat, 31 Oct 2009 16:22:25 -0400 Message-ID: Subject: Re: svn commit: r831502 - /couchdb/trunk/src/couchdb/couch_httpd_show.erl To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Oh, thanks for reminding me. I realized that this morning and then promptly got distracted by the football game. On Sat, Oct 31, 2009 at 6:01 AM, Jan Lehnardt wrote: > Hi Paul, > > is this worth a backport to 0.10? > > Cheers > Jan > -- > > On 31 Oct 2009, at 02:17, davisp@apache.org wrote: > >> Author: davisp >> Date: Sat Oct 31 01:17:04 2009 >> New Revision: 831502 >> >> URL: http://svn.apache.org/viewvc?rev=3D831502&view=3Drev >> Log: >> List functions weren't returning OS processes. >> >> Needed to add a call to couch_query_server:stop_map_doc/1 to return >> outstanding OS processes back to the query servers pools. This was >> causing some awesome errors by keeping the query_servers PID linked to >> the socket PID, which caused errors in apparently unrelated requests as >> the query_servers daemon was restarted on config changes. >> >> Also needed to move where the query servers were requested in list >> functions involving reduces. Map only lists were fine though. >> >> >> Modified: >> =A0 couchdb/trunk/src/couchdb/couch_httpd_show.erl >> >> Modified: couchdb/trunk/src/couchdb/couch_httpd_show.erl >> URL: >> http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_show.= erl?rev=3D831502&r1=3D831501&r2=3D831502&view=3Ddiff >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- couchdb/trunk/src/couchdb/couch_httpd_show.erl (original) >> +++ couchdb/trunk/src/couchdb/couch_httpd_show.erl Sat Oct 31 01:17:04 >> 2009 >> @@ -286,14 +286,14 @@ >> =A0 =A0 =A0 =A0skip =3D SkipCount, >> =A0 =A0 =A0 =A0group_level =3D GroupLevel >> =A0 =A0} =3D QueryArgs, >> - =A0 =A0% get the os process here >> - =A0 =A0% pass it into the view fold with closures >> - =A0 =A0{ok, QueryServer} =3D couch_query_servers:start_view_list(Lang, >> ListSrc), >> =A0 =A0Headers =3D MReq:get(headers), >> =A0 =A0Hlist =3D mochiweb_headers:to_list(Headers), >> =A0 =A0Accept =3D proplists:get_value('Accept', Hlist), >> =A0 =A0CurrentEtag =3D couch_httpd_view:view_group_etag(Group, Db, {Lang= , >> ListSrc, Accept, UserCtx}), >> =A0 =A0couch_httpd:etag_respond(Req, CurrentEtag, fun() -> >> + =A0 =A0 =A0 =A0% get the os process here >> + =A0 =A0 =A0 =A0% pass it into the view fold with closures >> + =A0 =A0 =A0 =A0{ok, QueryServer} =3D couch_query_servers:start_view_li= st(Lang, >> ListSrc), >> =A0 =A0 =A0 =A0StartListRespFun =3D make_reduce_start_resp_fun(QueryServ= er, Req, Db, >> CurrentEtag), >> =A0 =A0 =A0 =A0SendListRowFun =3D make_reduce_send_row_fun(QueryServer, = Db), >> >> @@ -316,14 +316,14 @@ >> =A0 =A0 =A0 =A0skip =3D SkipCount, >> =A0 =A0 =A0 =A0group_level =3D GroupLevel >> =A0 =A0} =3D QueryArgs, >> - =A0 =A0% get the os process here >> - =A0 =A0% pass it into the view fold with closures >> - =A0 =A0{ok, QueryServer} =3D couch_query_servers:start_view_list(Lang, >> ListSrc), >> =A0 =A0Headers =3D MReq:get(headers), >> =A0 =A0Hlist =3D mochiweb_headers:to_list(Headers), >> =A0 =A0Accept =3D proplists:get_value('Accept', Hlist), >> =A0 =A0CurrentEtag =3D couch_httpd_view:view_group_etag(Group, Db, {Lang= , >> ListSrc, Accept, UserCtx, Keys}), >> =A0 =A0couch_httpd:etag_respond(Req, CurrentEtag, fun() -> >> + =A0 =A0 =A0 =A0% get the os process here >> + =A0 =A0 =A0 =A0% pass it into the view fold with closures >> + =A0 =A0 =A0 =A0{ok, QueryServer} =3D couch_query_servers:start_view_li= st(Lang, >> ListSrc), >> =A0 =A0 =A0 =A0StartListRespFun =3D make_reduce_start_resp_fun(QueryServ= er, Req, Db, >> CurrentEtag), >> =A0 =A0 =A0 =A0SendListRowFun =3D make_reduce_send_row_fun(QueryServer, = Db), >> >> @@ -365,6 +365,7 @@ >> =A0 =A0 =A0 =A0 =A0 =A0[<<"end">>, Chunks] =3D >> couch_query_servers:render_list_tail(QueryServer), >> =A0 =A0 =A0 =A0 =A0 =A0send_non_empty_chunk(Resp, ?b2l(?l2b(Chunks))) >> =A0 =A0end, >> + =A0 =A0couch_query_servers:stop_doc_map(QueryServer), >> =A0 =A0last_chunk(Resp). >> >> >> >> > >