Bug 47420

Summary: ldap extended request not closing connections during add request
Product: JMeter - Now in Github Reporter: ae <abedwardsw>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: major    
Priority: P2    
Version: 2.3.3   
Target Milestone: ---   
Hardware: All   
OS: All   

Description ae 2009-06-24 16:44:06 UTC
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();
        }
Comment 1 Sebb 2009-06-25 11:21:31 UTC
This is deliberate.

You need to call bind at the start of a test sequence, and unbind at the end.
Comment 2 ae 2009-06-25 11:31:35 UTC
(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.
Comment 3 Sebb 2009-06-26 11:46:18 UTC
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
Comment 4 The ASF infrastructure team 2022-09-24 20:37:43 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2251