<< Back to previous view

[GLASSFISH-19433] JNDI lookup causes file descriptor leak Created: 12/Dec/12  Updated: 21/Mar/13  Resolved: 21/Mar/13

Status: Closed
Project: glassfish
Component/s: None
Affects Version/s: v2.1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: myyron Assignee: guojun.shan
Resolution: Won't Fix Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

SLES9


Tags: jndi leak
Participants: guojun.shan, myyron and shreedhar_ganapathy

 Description   

Whenever i do a remote lookup for a JNDI (tested on jms connection factory OR JDBC JNDI), there is always 1 file descriptor open left when my client application exits. I tried closing the context but still this did not resolve the issue.

Sample code:
InitialContext ic = null;
Properties properties = new Properties();
properties.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
properties.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
properties.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
properties.setProperty("org.omg.CORBA.ORBInitialHost", "testserver");
properties.setProperty("org.omg.CORBA.ORBInitialPort", "3100");

ConnectionFactory cf = null;
try { ic = new InitialContext(properties); cf = (ConnectionFactory) ic.lookup("jms/MyFactory"); } catch (Exception ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } finally { ic.close(); System.exit(1); }

How I confirmed the file descriptor still remains open in linux:
cd /proc/<glassfish pid>/fd
ls | wc -l
lsof -p <glassfish pid>



 Comments   
Comment by shreedhar_ganapathy [ 13/Dec/12 06:34 PM ]

Assigned to Michael for further reassignment - this issue is a v2.1.1 issue so needs to be triaged on whether this would affect current 3.x releases or 4.0

Comment by myyron [ 08/Jan/13 08:12 AM ]

Pls change priority of this issue to "Critical", as the open file limit problem causes the GlassFish to crash.

Our existing workaround for this problem is to monitor the number of open files for the GlassFish process and restart the domain whenever it is nearing the open files limit.

Thanks.

Comment by guojun.shan [ 16/Jan/13 06:57 AM ]

what is your the type of your client? standalone java client or application client?
did you try it with the latest version of Glassfish server?
what is your defintion of fd leak? the number of fd opened increase very time when you do remote JNDI access?

maybe we can disccuss it via email? guojun.shan@oracle.com

Comment by myyron [ 16/Jan/13 07:22 AM ]

thanks, lets dicuss through email, will send the reply shortly.

Comment by guojun.shan [ 21/Jan/13 02:33 AM ]

No such kind of issue on V3 and V4. suggest users to upgrade their Glassfish Server.

Comment by guojun.shan [ 21/Mar/13 02:38 AM ]

No such kind of issue on V3 and V4. suggest users to upgrade their Glassfish Server.

Generated at Thu Apr 17 08:29:50 UTC 2014 using JIRA 4.0.2#472.