Skip to content
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

Embedded LDAP thread is not terminated correctly in integration tests #2196

Open
holgerhagen opened this issue Mar 24, 2023 · 2 comments
Open
Labels

Comments

@holgerhagen
Copy link
Contributor

Taken from a REST integration test (e.g.ClassificationControllerIntTest) - can we fix this easily?

2023-03-24T08:56:37.5308588Z 2023-03-24 08:56:37.499 WARN 1876 --- [ main] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [Thread-178] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
2023-03-24T08:56:37.5309415Z [email protected]/java.net.SocketInputStream.socketRead0(Native Method)
2023-03-24T08:56:37.5309885Z [email protected]/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
2023-03-24T08:56:37.5310343Z [email protected]/java.net.SocketInputStream.read(SocketInputStream.java:168)
2023-03-24T08:56:37.5311072Z [email protected]/java.net.SocketInputStream.read(SocketInputStream.java:140)
2023-03-24T08:56:37.5311556Z [email protected]/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
2023-03-24T08:56:37.5312187Z [email protected]/java.io.BufferedInputStream.read1(BufferedInputStream.java:292)
2023-03-24T08:56:37.5312690Z [email protected]/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
2023-03-24T08:56:37.5313169Z [email protected]/com.sun.jndi.ldap.Connection.run(Connection.java:855)
2023-03-24T08:56:37.5313570Z [email protected]/java.lang.Thread.run(Thread.java:829)

@nyuuyn
Copy link
Contributor

nyuuyn commented Aug 1, 2023

As far as I can tell after investigation the problem is that the client (LDAPTemplate) is not closed before shutting down the server, and it is completely controlled by spring right now.
It seems the server is shutdown way before the client, e.g., when hooking in a destroy method for the client to close the connection the exception has already happened.

Closing the client before the server should solve it, however, at this moment it seems to be only an issue while testing right?

@jamesrdi
Copy link
Contributor

I cannot reproduce this bug anymore, maybe it has been solved due to the spring boot update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

5 participants