Hendy Irawan created DIRAPI-97:
----------------------------------
Summary: Unreliable LdapConnectionPool:
org.apache.directory.ldap.client.api.exception.InvalidConnectionException:
Cannot connect on the server, the connection is invalid
Key: DIRAPI-97
URL: https://issues.apache.org/jira/browse/DIRAPI-97
Project: Directory Client API
Issue Type: Bug
Affects Versions: 1.0.0-M13
Environment: Karaf
Karaf version 2.3.0
Karaf home /home/karaf/karaf
Karaf base /home/karaf/karaf
OSGi Framework org.apache.felix.framework - 4.0.3
JVM
Java Virtual Machine Java HotSpot(TM) Server VM version 23.5-b02
Version 1.7.0_09
Vendor Oracle Corporation
Uptime 4 days 7 hours
Total compile time 54.019 seconds
Threads
Live threads 119
Daemon threads 92
Peak 149
Total started 3151
Memory
Current heap size 63,365 kbytes
Maximum heap size 506,816 kbytes
Committed heap size 126,912 kbytes
Pending objects 0
Garbage collector Name = 'Copy', Collections = 970, Time = 6.659
seconds
Garbage collector Name = 'MarkSweepCompact', Collections = 111,
Time = 31.891 seconds
Classes
Current classes loaded 13,396
Total classes loaded 15,142
Total classes unloaded 1,746
Operating system
Name Linux version 3.6.5-linode47
Architecture i386
Processors 4
Reporter: Hendy Irawan
Priority: Critical
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 :
{code}
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
{code}
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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira