-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Jedis preventing application to close #49
Comments
Hi Mathieu, Thanks! |
Hi, We are using the version deployed at http://repo2.maven.org/maven2/redis/clients/jedis/ There is no problem for us for the deprecation: we only have one implementation depending on the core and we will be glad to switch and use a more stable pool when 1.5.0 will be released. Thanks a lot, Mathieu. |
Ok. Great. Thanks! |
Seems that this is still an issue, solved by this commit of commons-pool: https://github.com/apache/commons-pool/pull/20/files The eviction timer should be a daemon thread. |
Hi,
We are using Jedis for a very large website. When integrating it, we saw an issue with the way Repair threads are used.
if no Redis daemon is available, the following commands block the shutdown of the application:
The destroy thread block at:
in the destroy method. The cause is that the repair threads never stops and thus the join does not finish.
I saw that the repair threads are not stoppable because of the following code in JedisPool.createResource() method:
When no Redis daemon is available, the while loop keeps looping and the Interrupted exception is simply ignored.
As you may know, as a library developper, it is really not recommanded to catch Interrupted exception. If it is necessary, you should restore the interrupt status that the exception throwing cleared.
The following code fixes the issue:
Note that the return null; may be acceptable there since we are in the case where the shutdown method has been called to interrupt the repair threads. So we are exiting the program.
This enables Repair threads to stop and then unblock the program shutdown.
For the moment, a quick hugly fix for those who needs the patch is to override the createResource() method and apply the above patch in it.
Thanks,
Mathieu Carbou
mathieu.carbou@gmail.com
The text was updated successfully, but these errors were encountered: