From b99992a8f50770d0e2e6129fccb6da42f8ad7efe Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 22 Jan 2014 21:01:33 +0000 Subject: [PATCH] DATAREDIS-257 - Shutdown the client when DefaultLettucePool is destroyed. DefaultLettucePool manages a RedisClient instance that's created when afterPropertiesSet is called. The client was not being shutdown as part of the pool's destroy() processing leading to a resource leak. On OS X this would manifest itself as a growing number of kqueue file descriptors being consumed eventually leading to a failure when something tries to get a file descriptor and is unable to do so. This commit updates destroy() to call the client's shutdown() method. Original pull request: #26 --- .../data/redis/connection/lettuce/DefaultLettucePool.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/DefaultLettucePool.java b/src/main/java/org/springframework/data/redis/connection/lettuce/DefaultLettucePool.java index f303dbc6b..34b6f073e 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/DefaultLettucePool.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/DefaultLettucePool.java @@ -114,6 +114,7 @@ public class DefaultLettucePool implements LettucePool, InitializingBean { public void destroy() { try { + client.shutdown(); internalPool.close(); } catch (Exception e) { throw new PoolException("Could not destroy the pool", e);