LDAPConnectionFactory is not closed when PersistentSearch is restarted, leaving large number of LDAP connections
- install 13.5.1 or above with
- login to admin console with amadmin (to make sure IdRepo is initialized and cached)
- stop external user datastore
- start external user datastore
- notice "addListener invoked" is printed in IdRepo, but not "removelistener invoked"
- run jmap command to get heapdump
- run jhat and check the number of LDAPConnectionFactory with JQuery
- repeat stop/start external user datastore and notice the number of CachedConnectionPool/LDAPConnectionFactory class instances slowly increase.
Also, you will eventually see exceptions such as :
CachedConnectionPool/LDAPConnectionFactory should be closed properly
The number of CachedConnectionPool/LDAPConnectionFactory class instances slowly increase until the exceptions start showing.
OPENAM-10852 has removed IdRepo.removeListener which called LDAPv3PersistentSearch.stopSearch() which closed LDAPConnectionFactory.
OPENAM-10852 can be fixed by just skipping IdRepo.shutdown call.