spring-session: TestContainers related memory leaks
When running the build I see warnings like this:
:spring-session-sample-javaconfig-redis:jar UP-TO-DATE
:spring-session-sample-javaconfig-redis:integrationTest
:spring-session-sample-javaconfig-redis:appAfterIntegrationTest
19:43:55.657 [localhost-startStop-1] INFO o.s.w.c.s.AnnotationConfigWebApplicationContext - Closing Root WebApplicationContext: startup date [Thu Sep 07 19:43:50 CDT 2017]; root of context hierarchy
19:43:55.658 [localhost-startStop-1] INFO o.s.c.s.DefaultLifecycleProcessor - Stopping beans in phase 2147483647
19:43:57 WARN The web application [ROOT] appears to have started a thread named [dockerjava-netty-1-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Thread.sleep(Native Method)
org.testcontainers.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.confirmShutdown(SingleThreadEventExecutor.java:705)
org.testcontainers.shaded.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:325)
org.testcontainers.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
org.testcontainers.shaded.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
java.lang.Thread.run(Thread.java:745)
19:43:57 WARN The web application [ROOT] appears to have started a thread named [threadDeathWatcher-3-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Thread.sleep(Native Method)
org.testcontainers.shaded.io.netty.util.ThreadDeathWatcher$Watcher.run(ThreadDeathWatcher.java:152)
org.testcontainers.shaded.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
java.lang.Thread.run(Thread.java:745)
19:43:57 WARN The web application [ROOT] appears to have started a thread named [dockerjava-netty-1-2] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Thread.sleep(Native Method)
org.testcontainers.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.confirmShutdown(SingleThreadEventExecutor.java:705)
org.testcontainers.shaded.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:325)
org.testcontainers.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
org.testcontainers.shaded.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
java.lang.Thread.run(Thread.java:745)
we should ensure all the threads are shutdown properly
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 18 (12 by maintainers)
Thanks for both your input. We will try to investigate in Testcontainers if we have enough control over those threads, to terminate them in an orderly fashion.
The threads from OkHttp might we out of our control though, but we’ll check it.