Bug 47420 - ldap extended request not closing connections during add request
Summary: ldap extended request not closing connections during add request
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.3.3
Hardware: All All
: P2 major (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-24 16:44 UTC by ae
Modified: 2009-06-26 11:46 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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