diff options
author | Robert Newson <rnewson@apache.org> | 2011-05-28 16:50:10 +0000 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2011-05-28 16:50:10 +0000 |
commit | 31e900ee642e672cec0b7b561c4bb596e1acf9a5 (patch) | |
tree | 2bc170c12a0575fe9ca0f2da1d418e2e72e0f1bb /src/couchdb | |
parent | 57bb30a736a7e0635c3cab394b946b1acbbed266 (diff) |
COUCHDB-1171 Multiple requests to _changes feed causes {error, system_limit} "Too many processes"
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1128704 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r-- | src/couchdb/couch_httpd_db.erl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl index f51fde09..e3638b25 100644 --- a/src/couchdb/couch_httpd_db.erl +++ b/src/couchdb/couch_httpd_db.erl @@ -114,11 +114,16 @@ handle_changes_req1(Req, Db) -> 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_compact_req(#httpd{method='POST',path_parts=[DbName,_,Id|_]}=Req, Db) -> ok = couch_db:check_is_admin(Db), |