-
Notifications
You must be signed in to change notification settings - Fork 550
Connection pool is shut down #446
Comments
Is the stacktrace originating from code in the |
@mattnworb yes. We have a set of private methods being called inside this try-with-resources like the following:
So far as I can understand we're using default connection pool size = 100. Can I somehow enable debug logging to insert client output here? |
Is it possible that any of the methods are storing a reference to the DockerClient and calling methods on it from another thread after the initial thread has moved passed the try-with-resources block? From a quick glance, the apache httpclient only throws those exceptions after someone has called docker-client logs via slf4j, so you can see more info by configuring it, although there isn't a ton of logging. Apache HttpClient uses JCL which you'll have to configure as well. |
@mattnworb we're using executors inside these methods. Will try to use one client per thread to eliminate this factor. |
@vania-pooh a quick way to verify if the problem is indeed that the main thread is exiting the Assuming this is the case, you will want to add some sort of synchronization between the executors and this main thread, so that the DockerClient is not closed until all of the work in your app is done. |
@mattnworb we checked this capability and can state that we do awaitTermination and shutdown for executor service inside try block. |
Is it possible to produce a code sample that shows this in action, and/or steps to reproduce? I am not sure how to reproduce it on my own. Have you tried to set a breakpoint on DefaultDockerClient.close() to see when it is being called and by whom? |
I've just had this issue in my unit tests when running two suites in parallel - it seems two distinct docker clients share a jersey pool, such that if I have one in each test suite and I close one of them at the end of my suite, it closes the underlying pool, breaking the other client. |
@giftig running two suites in parallel in two separate JVM instances? Is it possible to create a small project that uses the same version of Jersey etc that reproduces this problem? |
It's a single JVM; I'll see if I can reproduce it with a small test project soon; sorry, don't have a lot of time right now. |
@mattnworb Has there been any movement on understanding or solving this issue? Is there any information I could contribute to help? Thanks |
* make default docker client thread safe * reapplied fix after merge * checkstyle * checkstyle and imports
Description
Getting
Connection pool is shut down
after some time. Seems to be a Jersey issue.How to reproduce
We have a daemon process using the client like that:
What do you expect
Client should continue to work.
What happened instead
Client connection pool is shut down.
Software:
Full backtrace
The text was updated successfully, but these errors were encountered: