Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 845044D85 for ; Fri, 27 May 2011 11:14:29 +0000 (UTC) Received: (qmail 41160 invoked by uid 500); 27 May 2011 11:14:29 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 41100 invoked by uid 500); 27 May 2011 11:14:28 -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 41092 invoked by uid 99); 27 May 2011 11:14:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 May 2011 11:14:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 May 2011 11:14:27 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 5DF60E25B8 for ; Fri, 27 May 2011 11:13:47 +0000 (UTC) Date: Fri, 27 May 2011 11:13:47 +0000 (UTC) From: "Alexander Shorin (JIRA)" To: dev@couchdb.apache.org Message-ID: <1921616839.48449.1306494827381.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <84660738.26922.1305818207393.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Reopened] (COUCHDB-1171) Multiple requests to _changes feed causes {error, system_limit} "Too many processes" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexander Shorin reopened COUCHDB-1171: --------------------------------------- Skill Level: New Contributors Level (Easy) > Multiple requests to _changes feed causes {error, system_limit} "Too many processes" > ------------------------------------------------------------------------------------ > > Key: COUCHDB-1171 > URL: https://issues.apache.org/jira/browse/COUCHDB-1171 > Project: CouchDB > Issue Type: Bug > Affects Versions: 1.0.2, 1.0.3, 1.1 > Reporter: Alexander Shorin > Attachments: couchdb-changes-stats-process-leak-test.js, couchdb-changes-stats-process-leak.patch > > > Originally I have investigated of issue 182 of couchdb-python package where calling db.changes() function over 32768 times generates next messages in CouchDB log: > [Thu, 19 May 2011 14:03:26 GMT] [info] [<0.2909.0>] 127.0.0.1 - - 'GET' /test/_changes 200 > [Thu, 19 May 2011 14:03:26 GMT] [error] [emulator] Too many processes > [Thu, 19 May 2011 14:03:26 GMT] [error] [<0.2909.0>] Uncaught error in HTTP request: {error,system_limit} > [Thu, 19 May 2011 14:03:26 GMT] [info] [<0.2909.0>] Stacktrace: [{erlang,spawn, > [erlang,apply, > [#Fun,[]]]}, > {erlang,spawn,1}, > {couch_httpd_db,handle_changes_req,2}, > {couch_httpd_db,do_db_req,2}, > {couch_httpd,handle_request_int,5}, > {mochiweb_http,headers,5}, > {proc_lib,init_p_do_apply,3}] > [Thu, 19 May 2011 14:03:26 GMT] [info] [<0.2909.0>] 127.0.0.1 - - 'GET' /test/_changes 500 > More info about this issue could be found there: http://code.google.com/p/couchdb-python/issues/detail?id=182 > However, I still couldn't reproduce this error using only httplib module, but I've got that same behavior using feed=longpool option: > from httplib import HTTPConnection > def test2(): > conn = HTTPConnection('localhost:5984') > conn.connect() > i = 0 > while(True): > conn.putrequest('GET', '/test/_changes?feed=longpool') > conn.endheaders() > conn.getresponse().read() > i = i + 1 > if i % 100 == 0: > print i > When i get's around 32667 exception raises > Traceback (most recent call last): > File "/home/kxepal/projects/couchdb-python/issue-182/test.py", line 259, in > test2() > File "/home/kxepal/projects/couchdb-python/issue-182/test.py", line 239, in test2 > resp.read() > File "/usr/lib/python2.6/httplib.py", line 522, in read > return self._read_chunked(amt) > File "/usr/lib/python2.6/httplib.py", line 565, in _read_chunked > raise IncompleteRead(''.join(value)) > httplib.IncompleteRead: IncompleteRead(0 bytes read) > [Thu, 19 May 2011 14:10:20 GMT] [info] [<0.3240.4>] 127.0.0.1 - - 'GET' /test/_changes?feed=longpool 200 > [Thu, 19 May 2011 14:10:20 GMT] [error] [emulator] Too many processes > [Thu, 19 May 2011 14:10:20 GMT] [error] [<0.3240.4>] Uncaught error in HTTP request: {error,system_limit} > [Thu, 19 May 2011 14:10:20 GMT] [info] [<0.3240.4>] Stacktrace: [{erlang,spawn, > [erlang,apply, > [#Fun,[]]]}, > {erlang,spawn,1}, > {couch_httpd_db,handle_changes_req,2}, > {couch_httpd_db,do_db_req,2}, > {couch_httpd,handle_request_int,5}, > {mochiweb_http,headers,5}, > {proc_lib,init_p_do_apply,3}] > [Thu, 19 May 2011 14:10:20 GMT] [info] [<0.3240.4>] 127.0.0.1 - - 'GET' /test/_changes?feed=longpool 500 > Same error. I know, that test function is quite outside from real use case, but is this correct behavior and couldn't it be used in malicious aims? > This exception occurres only for multiple requests within single connection for changes feed, chunked lists or attachments are not affected, if I've done all right. > Test environment: > Gentoo Linux 2.6.38 > CouchDB 1.0.2 release > couchdb-python@63feefd9e3b6 > Python 2.6.6 > If there is needed some additional information I could try to provide it. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira