-
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
Pooled Connections shouldn't be closed if they have socket timeouts #2108
Comments
We are also facing the same problem. Any solution? In our case, redis max memory limit is reached and the spike in connection (occupies more memory) led to the huge key eviction. |
yangbodong22011
added a commit
to yangbodong22011/jedis
that referenced
this issue
Apr 3, 2023
Please refer to: redis/redis#11420 This PR cancels calling the quit command when the Jedis internal link is abnormal, but the user interface `Jedis.quit()` is not affected. This optimizes Jedis connection pool performance and fixes: redis#2105 redis#2108
yangbodong22011
added a commit
to yangbodong22011/jedis
that referenced
this issue
Apr 4, 2023
Please refer to: redis/redis#11420 This PR cancels calling the quit command when the Jedis internal link is abnormal, and deprecate the user interface `Jedis.quit()`. This optimizes Jedis connection pool performance and fixes: redis#2105 redis#2108
closed by #3353 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following line can throw a SocketTimeoutException and in that case, the connection is marked as broken.
https://github.com/xetorthio/jedis/blob/6126d30efccb8921dcf9a03776299a504e022a3e/src/main/java/redis/clients/jedis/Connection.java#L126
Then when the close() method is called (the intention is to add the connection back to the pool), then the broken client is eventually closed:
https://github.com/xetorthio/jedis/blob/6126d30efccb8921dcf9a03776299a504e022a3e/src/main/java/redis/clients/jedis/Jedis.java#L3458
The above call will end up in the invalidateObject() method in the commons-pool2:
https://github.com/apache/commons-pool/blob/f4455dcb8afaf9ae7054589110f1082a7a8a282c/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java#L607
which eventually will call:
https://github.com/xetorthio/jedis/blob/6126d30efccb8921dcf9a03776299a504e022a3e/src/main/java/redis/clients/jedis/JedisFactory.java#L94
This is the cause of issue #2105, where the guys see a large number of new connections. I was able to reproduce it by lowering the socket timeout.
The text was updated successfully, but these errors were encountered: