-
Notifications
You must be signed in to change notification settings - Fork 487
LDAP connection not closed due to DefaultDirContextValidator #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I confirm the need to close the NamingEnumeration object. There is leak when the default validation process is enabled. For your information, I'm using Java 11.0.6, Spring Ldap 2.3.2, Commons Pool 2.8, Spring 5.2.5 and Tomcat 8.5.53. Thank you in advance for taking this problem into account. Chris |
Thanks for the report and follow up. Any chance one of you would be interested in submitting a PR for this? |
PR done but Travis build failed. |
@antoine777 Thanks for the PR. I think the issue is that we need to switch to openjdk as Travis no longer has oracle jdk 8. Would you mind sending a PR for this? This is what the change looked like for Spring Security spring-projects/spring-security@ca81421#diff-354f30a63fb0907d4ad57269548329e3 |
@rwinch some other modifications were necessary to fix the build. |
@antoine777 Thanks I commented on your PR |
Fantastic, 3,5 years later! |
DefaultDirContextValidator
class doesn't closeNamingEnumeration
searchResults.As a consequence, the LDAP connection associated with the
DirContext
can't be closed when requested by the pool.It's conform to the documentation : https://docs.oracle.com/javase/tutorial/jndi/ldap/close.html
"If the Context instance is sharing a connection with other Context and unterminated NamingEnumeration instances, the connection will not be closed until close() has been invoked on all such Context and NamingEnumeration instances"
DefaultDirContextValidator
should close theNamingEnumeration
searchResults in a finally block :The text was updated successfully, but these errors were encountered: