You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2011/06/15 02:56:46 UTC

svn commit: r1135881 - in /couchdb/branches/1.0.x: ./ etc/default/couchdb share/www/script/test/changes.js src/couchdb/couch_httpd_db.erl

Author: davisp
Date: Wed Jun 15 00:56:46 2011
New Revision: 1135881

URL: http://svn.apache.org/viewvc?rev=1135881&view=rev
Log:
Backport of 1128703 from trunk.

COUCHDB-1171 Multiple requests to _changes feed causes {error, system_limit} "Too many processes"


Modified:
    couchdb/branches/1.0.x/   (props changed)
    couchdb/branches/1.0.x/etc/default/couchdb   (props changed)
    couchdb/branches/1.0.x/share/www/script/test/changes.js
    couchdb/branches/1.0.x/src/couchdb/couch_httpd_db.erl

Propchange: couchdb/branches/1.0.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jun 15 00:56:46 2011
@@ -6,4 +6,4 @@
 /couchdb/branches/list-iterator:782292-784593
 /couchdb/branches/tail_header:775760-778477
 /couchdb/tags/0.10.0:825400
-/couchdb/trunk:984170,984178,984214,984228,984237,984241,984501,991073,1029025-1029026,1029030,1035447,1045203,1083714,1095557,1095581,1097300,1099479,1102006
+/couchdb/trunk:984170,984178,984214,984228,984237,984241,984501,991073,1029025-1029026,1029030,1035447,1045203,1083714,1095557,1095581,1097300,1099479,1102006,1128703

Propchange: couchdb/branches/1.0.x/etc/default/couchdb
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jun 15 00:56:46 2011
@@ -6,5 +6,5 @@
 /couchdb/branches/list-iterator/etc/default/couchdb:782292-784593
 /couchdb/branches/tail_header/etc/default/couchdb:775760-778477
 /couchdb/tags/0.10.0/etc/default/couchdb:825400
-/couchdb/trunk/etc/default/couchdb:984170,984178,984214,984228,984237,984241,984501,991073,1029025-1029026,1029030,1035447,1045203,1083714,1095557,1095581,1097300,1099479,1102006
+/couchdb/trunk/etc/default/couchdb:984170,984178,984214,984228,984237,984241,984501,991073,1029025-1029026,1029030,1035447,1045203,1083714,1095557,1095581,1097300,1099479,1102006,1128703
 /incubator/couchdb/trunk/etc/default/couchdb:642419-694440

Modified: couchdb/branches/1.0.x/share/www/script/test/changes.js
URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/share/www/script/test/changes.js?rev=1135881&r1=1135880&r2=1135881&view=diff
==============================================================================
--- couchdb/branches/1.0.x/share/www/script/test/changes.js (original)
+++ couchdb/branches/1.0.x/share/www/script/test/changes.js Wed Jun 15 00:56:46 2011
@@ -440,6 +440,10 @@ couchTests.changes = function(debug) {
   TEquals("0", resp.results[0].id);
   TEquals("1", resp.results[1].id);
 
+  TEquals(0, CouchDB.requestStats('httpd', 'clients_requesting_changes').current);
+  CouchDB.request("GET", "/" + db.name + "/_changes");
+  TEquals(0, CouchDB.requestStats('httpd', 'clients_requesting_changes').current);
+
   // cleanup
   db.deleteDb();
 };

Modified: couchdb/branches/1.0.x/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/src/couchdb/couch_httpd_db.erl?rev=1135881&r1=1135880&r2=1135881&view=diff
==============================================================================
--- couchdb/branches/1.0.x/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/branches/1.0.x/src/couchdb/couch_httpd_db.erl Wed Jun 15 00:56:46 2011
@@ -106,10 +106,16 @@ handle_changes_req(#httpd{method='GET'}=
             FeedChangesFun(MakeCallback(Resp))
         end
     end,
-    couch_stats_collector:track_process_count(
+    couch_stats_collector:increment(
         {httpd, clients_requesting_changes}
     ),
-    WrapperFun(ChangesFun);
+    try
+        WrapperFun(ChangesFun)
+    after
+    couch_stats_collector:decrement(
+        {httpd, clients_requesting_changes}
+    )
+    end;
 
 handle_changes_req(#httpd{path_parts=[_,<<"_changes">>]}=Req, _Db) ->
     send_method_not_allowed(Req, "GET,HEAD").