dyno icon indicating copy to clipboard operation
dyno copied to clipboard

JedisConnection - Socket not closed properly when redis.quit command fails

Open rprevot opened this issue 5 years ago • 1 comments

Hi,

When a host is unreachable or read timeouts are encountered, the JedisConnection.close() method doesn't ensure that the socket is properly closed :

    @Override
    public void close() {
        jedisClient.quit();
        jedisClient.disconnect();
    }

I.e, the jedisClient.disconnect() is never called if the jedisClient.quit() fails.

Under heavy load, the number of TCP connections in ESTABLISHED state can go beyond the configured connection pool size (MaxConnsPerHost).

rprevot avatar Apr 12 '20 14:04 rprevot

@rprevot we are experiencing similar issues especially when we have abrupt issues on one or more Dynomite nodes in the cluster. Restarting the clients once the Dynomite becomes healthy brings the connections to a normal state (within the configured #max pool size). The fix you have suggested is still in the open state. Do the changes you suggested solve the problem in your environment?

murthy-chelankuri avatar Jan 03 '23 19:01 murthy-chelankuri