glassfish
  1. glassfish
  2. GLASSFISH-19433

JNDI lookup causes file descriptor leak

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: v2.1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      SLES9

      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>

        Activity

        Hide
        guojun.shan added a comment -

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

        Show
        guojun.shan added a comment - No such kind of issue on V3 and V4. suggest users to upgrade their Glassfish Server.
        Hide
        guojun.shan added a comment -

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

        Show
        guojun.shan added a comment - No such kind of issue on V3 and V4. suggest users to upgrade their Glassfish Server.
        Hide
        myyron added a comment -

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

        Show
        myyron added a comment - thanks, lets dicuss through email, will send the reply shortly.
        Hide
        guojun.shan added a comment -

        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

        Show
        guojun.shan added a comment - 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
        Hide
        myyron added a comment -

        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.

        Show
        myyron added a comment - 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.
        Hide
        shreedhar_ganapathy added a comment -

        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

        Show
        shreedhar_ganapathy added a comment - 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

          People

          • Assignee:
            guojun.shan
            Reporter:
            myyron
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: