Uploaded image for project: 'Directory Client API'
  1. Directory Client API
  2. DIRAPI-97

Unreliable LdapConnectionPool: org.apache.directory.ldap.client.api.exception.InvalidConnectionException: Cannot connect on the server, the connection is invalid

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 1.0.0-M13
    • 1.0.0-M14
    • None

    Description

      We use LdapConnectionPool exclusively in order to increase performance without sacrificing stability.

      However, it seems that it's possible to break this and will cause :

      Caused by: org.apache.directory.shared.ldap.model.exception.LdapException: org.apache.directory.ldap.client.api
      .exception.InvalidConnectionException: Cannot connect on the server, the connection is invalid
              at org.apache.directory.ldap.client.api.LdapNetworkConnection.lookup(LdapNetworkConnection.java:3169)
              at org.apache.directory.ldap.client.api.LdapNetworkConnection.lookup(LdapNetworkConnection.java:3181)
              at org.apache.directory.ldap.client.api.LdapNetworkConnection.lookup(LdapNetworkConnection.java:3116)
              at id.co.bippo.shop.LdapShopDao$1.apply(LdapShopDao.java:88)
              ... 78 more
      Caused by: org.apache.directory.ldap.client.api.exception.InvalidConnectionException: Cannot connect on the ser
      ver, the connection is invalid
              at org.apache.directory.ldap.client.api.LdapNetworkConnection.checkSession(LdapNetworkConnection.java:2
      72)
              at org.apache.directory.ldap.client.api.LdapNetworkConnection.searchAsync(LdapNetworkConnection.java:15
      48)
              at org.apache.directory.ldap.client.api.LdapNetworkConnection.search(LdapNetworkConnection.java:1586)
              at org.apache.directory.ldap.client.api.LdapNetworkConnection.lookup(LdapNetworkConnection.java:3151)
              ... 81 more
      

      When it gets to this state, repeated calls to borrowObject/returnObject seem to return the same invalid connection(s).

      I can think of several reason why the connection was invalidated: LDAP connection breaks, LDAP server was restarted, but can be anything, really. However, I expect the pool would handle this, and purge invalid connections automatically.

      So that when ldapPool.borrowObject(); is called, the LdapConnection given should be valid & ready to use.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ceefour Hendy Irawan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: