From dev-return-38666-apmail-directory-dev-archive=directory.apache.org@directory.apache.org Wed Jul 27 16:19:35 2011 Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-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 998C96434 for ; Wed, 27 Jul 2011 16:19:35 +0000 (UTC) Received: (qmail 26945 invoked by uid 500); 27 Jul 2011 16:19:35 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 26880 invoked by uid 500); 27 Jul 2011 16:19:34 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 26868 invoked by uid 99); 27 Jul 2011 16:19:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 16:19:34 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,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; Wed, 27 Jul 2011 16:19:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id BD8C48D5AB for ; Wed, 27 Jul 2011 16:19:09 +0000 (UTC) Date: Wed, 27 Jul 2011 16:19:09 +0000 (UTC) From: "Emmanuel Lecharny (JIRA)" To: dev@directory.apache.org Message-ID: <2089574655.12475.1311783549772.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1924782030.11593.1311766750367.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DIRAPI-52) Connection seems to remain opened, leading to 'Too many open files' on some servers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DIRAPI-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13071833#comment-13071833 ] Emmanuel Lecharny commented on DIRAPI-52: ----------------------------------------- I do think that the comment (// DO NOT...) was added when we were using an old version of MINA, whch might have some bug. anyway... I have fixed the NPE by protecting the connector.dispose() call with a mutex, removing the localConnector variable. > Connection seems to remain opened, leading to 'Too many open files' on some servers > ----------------------------------------------------------------------------------- > > Key: DIRAPI-52 > URL: https://issues.apache.org/jira/browse/DIRAPI-52 > Project: Directory Client API > Issue Type: Bug > Affects Versions: 1.0.0-M4, 1.0.0-M5 > Environment: various, see description > Reporter: Martin Zdila > Priority: Critical > > Testcase: > final LdapConnectionConfig lcc = new LdapConnectionConfig(); > lcc.setLdapHost("ad.example.com"); > lcc.setUseSsl(true); > lcc.setLdapPort(LdapConnectionConfig.DEFAULT_LDAPS_PORT); > lcc.setTrustManagers(new NoVerificationTrustManager()); > for (int i = 0; i < 100; i++) { > System.out.println(i); > final LdapNetworkConnection connection = new LdapNetworkConnection(lcc); > connection.bind(); > final EntryCursor cursor = connection.search("ou=something,dc=example.com", "(&(cn=comeCommonName)(objectClass=person)(sn=*)(givenName=*))", SearchScope.SUBTREE, "cn"); > while (cursor.next()) { > cursor.get(); > } > connection.unBind(); > connection.close(); > Thread.sleep(1000); > } > Running this on some servers causes many open files and they are growing on each iteration: > lsof -p : > ... > java 18719 gofer 37u 0000 0,7 0 13 anon_inode > java 18719 gofer 38r FIFO 0,6 0t0 9155974 pipe > java 18719 gofer 39w FIFO 0,6 0t0 9155974 pipe > java 18719 gofer 40u 0000 0,7 0 13 anon_inode > java 18719 gofer 41r FIFO 0,6 0t0 9155976 pipe > java 18719 gofer 42w FIFO 0,6 0t0 9155976 pipe > java 18719 gofer 43u 0000 0,7 0 13 anon_inode > java 18719 gofer 44r FIFO 0,6 0t0 9155977 pipe > java 18719 gofer 45w FIFO 0,6 0t0 9155977 pipe > java 18719 gofer 46u 0000 0,7 0 13 anon_inode > java 18719 gofer 47r FIFO 0,6 0t0 9155978 pipe > java 18719 gofer 48w FIFO 0,6 0t0 9155978 pipe > java 18719 gofer 49u 0000 0,7 0 13 anon_inode > java 18719 gofer 50r FIFO 0,6 0t0 9155980 pipe > java 18719 gofer 51w FIFO 0,6 0t0 9155980 pipe > java 18719 gofer 52u 0000 0,7 0 13 anon_inode > java 18719 gofer 53r FIFO 0,6 0t0 9155981 pipe > java 18719 gofer 54w FIFO 0,6 0t0 9155981 pipe > java 18719 gofer 55u 0000 0,7 0 13 anon_inode > java 18719 gofer 56r FIFO 0,6 0t0 9155982 pipe > java 18719 gofer 57w FIFO 0,6 0t0 9155982 pipe > java 18719 gofer 58u 0000 0,7 0 13 anon_inode > java 18719 gofer 59r FIFO 0,6 0t0 9155984 pipe > java 18719 gofer 60w FIFO 0,6 0t0 9155984 pipe > java 18719 gofer 61u 0000 0,7 0 13 anon_inode > java 18719 gofer 62r FIFO 0,6 0t0 9155985 pipe > java 18719 gofer 63w FIFO 0,6 0t0 9155985 pipe > java 18719 gofer 64u 0000 0,7 0 13 anon_inode > java 18719 gofer 65r FIFO 0,6 0t0 9155986 pipe > java 18719 gofer 66w FIFO 0,6 0t0 9155986 pipe > ... and many many more > This happens on: > Linux somedns1 2.6.26-2-xen-686 #1 SMP Thu Jan 27 05:44:37 UTC 2011 i686 GNU/Linux > java version "1.6.0_26" > Java(TM) SE Runtime Environment (build 1.6.0_26-b03) > Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing) > Also on another platform, but there are slightly less open pipes and anon_inodes: > Linux somedns2 2.6.26-2-686-bigmem #1 SMP Wed Nov 4 21:12:12 UTC 2009 i686 GNU/Linux > java version "1.6.0_12" > Java(TM) SE Runtime Environment (build 1.6.0_12-b04) > Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode) > On my local computer I see only couple of open pipes and anon_inodes and they don't grow: > Linux bono 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux > java version "1.6.0_26" > Java(TM) SE Runtime Environment (build 1.6.0_26-b03) > Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode) > I've found slightly similar isse here: http://issues.opennms.org/browse/NMS-4631 > New file handlers are being opened by Apache Mina. I am not sure who is responsible for closing it. In my testcase the connection is properly closed. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira