During load testing of a bind,add,search,delete request I noticed connections to the LDAP server we're being left open until the first full GC occured. Upon further investigation I believe I have tracked the bug down. I have tested with the new code and it is now closing the connections properly. In the Class org.apache.jmeter.protocol.ldap.sampler.LDAPExtSampler Method Name: addTest old code: try { res.sampleStart(); ctx = ldap.createTest(dirContext, getUserAttributes(), getBaseEntryDN()); } finally { res.sampleEnd(); } new code: try { res.sampleStart(); DirContext ctx = ldap.createTest(dirContext, getUserAttributes(), getBaseEntryDN()); ctx.close(); } finally { res.sampleEnd(); }
This is deliberate. You need to call bind at the start of a test sequence, and unbind at the end.
(In reply to comment #1) > This is deliberate. > > You need to call bind at the start of a test sequence, and unbind at the end. sorry, didn't mention in my email that I AM calling bind/unbind. When the new user is created, it creates a separate context which needs to be closed. The code appears to be missing this close. My test sequence is Threads1 Loops 5000 Thread Bind Add Search Delete Thread Unbind If only doing searches or deletes, there is no thread leak. Only in the add/create.
OK, understood. Thanks for the report. Fixed in SVN: URL: http://svn.apache.org/viewvc?rev=788812&view=rev Log: Bug 47420 - LDAP extended request not closing connections during add request
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2251