From d77c6741d89661e3d4f5c50ec0a61fd5e2ab30bb Mon Sep 17 00:00:00 2001 From: sazzad16 Date: Tue, 9 Jan 2018 18:36:34 +0600 Subject: [PATCH 1/5] Remove JedisPoolAbstract and related changes JedisPoolAbstract itself was doing nothing except acting as access point of Pool from redis.clients.jedis package. Using Pool directly seems better. --- src/main/java/redis/clients/jedis/Jedis.java | 7 +++-- .../java/redis/clients/jedis/JedisPool.java | 29 +++++++++---------- .../clients/jedis/JedisPoolAbstract.java | 27 ----------------- .../clients/jedis/JedisSentinelPool.java | 17 +++++------ .../redis/clients/jedis/ShardedJedisPool.java | 4 +-- .../java/redis/clients/jedis/util/Pool.java | 17 ++++++----- 6 files changed, 37 insertions(+), 64 deletions(-) delete mode 100644 src/main/java/redis/clients/jedis/JedisPoolAbstract.java diff --git a/src/main/java/redis/clients/jedis/Jedis.java b/src/main/java/redis/clients/jedis/Jedis.java index 777e7b79e9..7b60c66063 100644 --- a/src/main/java/redis/clients/jedis/Jedis.java +++ b/src/main/java/redis/clients/jedis/Jedis.java @@ -27,13 +27,14 @@ import redis.clients.jedis.params.SetParams; import redis.clients.jedis.params.ZAddParams; import redis.clients.jedis.params.ZIncrByParams; +import redis.clients.jedis.util.Pool; import redis.clients.jedis.util.SafeEncoder; import redis.clients.jedis.util.Slowlog; public class Jedis extends BinaryJedis implements JedisCommands, MultiKeyCommands, AdvancedJedisCommands, ScriptingCommands, BasicCommands, ClusterCommands, SentinelCommands, ModuleCommands { - protected JedisPoolAbstract dataSource = null; + private Pool dataSource = null; public Jedis() { super(); @@ -3462,7 +3463,7 @@ public Map pubsubNumSub(String... channels) { @Override public void close() { if (dataSource != null) { - JedisPoolAbstract pool = this.dataSource; + Pool pool = this.dataSource; this.dataSource = null; if (client.isBroken()) { pool.returnBrokenResource(this); @@ -3474,7 +3475,7 @@ public void close() { } } - public void setDataSource(JedisPoolAbstract jedisPool) { + public void setDataSource(Pool jedisPool) { this.dataSource = jedisPool; } diff --git a/src/main/java/redis/clients/jedis/JedisPool.java b/src/main/java/redis/clients/jedis/JedisPool.java index 5e93de84e5..e677213e2b 100644 --- a/src/main/java/redis/clients/jedis/JedisPool.java +++ b/src/main/java/redis/clients/jedis/JedisPool.java @@ -6,13 +6,13 @@ import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLSocketFactory; -import org.apache.commons.pool2.impl.GenericObjectPool; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; import redis.clients.jedis.exceptions.JedisException; import redis.clients.jedis.util.JedisURIHelper; +import redis.clients.jedis.util.Pool; -public class JedisPool extends JedisPoolAbstract { +public class JedisPool extends Pool { public JedisPool() { this(Protocol.DEFAULT_HOST, Protocol.DEFAULT_PORT); @@ -29,12 +29,11 @@ public JedisPool(String host, int port) { public JedisPool(final String host) { URI uri = URI.create(host); if (JedisURIHelper.isValid(uri)) { - this.internalPool = new GenericObjectPool(new JedisFactory(uri, - Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, null), new GenericObjectPoolConfig()); + initPool(new GenericObjectPoolConfig(), new JedisFactory(uri, Protocol.DEFAULT_TIMEOUT, + Protocol.DEFAULT_TIMEOUT, null)); } else { - this.internalPool = new GenericObjectPool(new JedisFactory(host, - Protocol.DEFAULT_PORT, Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, null, - Protocol.DEFAULT_DATABASE, null), new GenericObjectPoolConfig()); + initPool(new GenericObjectPoolConfig(), new JedisFactory(host, Protocol.DEFAULT_PORT, + Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, null, Protocol.DEFAULT_DATABASE, null)); } } @@ -42,13 +41,12 @@ public JedisPool(final String host, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { URI uri = URI.create(host); if (JedisURIHelper.isValid(uri)) { - this.internalPool = new GenericObjectPool(new JedisFactory(uri, - Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, null, sslSocketFactory, sslParameters, - hostnameVerifier), new GenericObjectPoolConfig()); + initPool(new GenericObjectPoolConfig(), new JedisFactory(uri, Protocol.DEFAULT_TIMEOUT, + Protocol.DEFAULT_TIMEOUT, null, sslSocketFactory, sslParameters, hostnameVerifier)); } else { - this.internalPool = new GenericObjectPool(new JedisFactory(host, - Protocol.DEFAULT_PORT, Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, null, - Protocol.DEFAULT_DATABASE, null, false, null, null, null), new GenericObjectPoolConfig()); + initPool(new GenericObjectPoolConfig(), new JedisFactory(host, Protocol.DEFAULT_PORT, + Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, null, Protocol.DEFAULT_DATABASE, null, + false, null, null, null)); } } @@ -237,21 +235,20 @@ public Jedis getResource() { } @Override - protected void returnBrokenResource(final Jedis resource) { + public void returnBrokenResource(final Jedis resource) { if (resource != null) { returnBrokenResourceObject(resource); } } @Override - protected void returnResource(final Jedis resource) { + public void returnResource(final Jedis resource) { if (resource != null) { try { resource.resetState(); returnResourceObject(resource); } catch (Exception e) { returnBrokenResource(resource); - throw new JedisException("Resource is returned to the pool as broken", e); } } } diff --git a/src/main/java/redis/clients/jedis/JedisPoolAbstract.java b/src/main/java/redis/clients/jedis/JedisPoolAbstract.java deleted file mode 100644 index 9089bb5a53..0000000000 --- a/src/main/java/redis/clients/jedis/JedisPoolAbstract.java +++ /dev/null @@ -1,27 +0,0 @@ -package redis.clients.jedis; - -import org.apache.commons.pool2.PooledObjectFactory; -import org.apache.commons.pool2.impl.GenericObjectPoolConfig; - -import redis.clients.jedis.util.Pool; - -public class JedisPoolAbstract extends Pool { - - public JedisPoolAbstract() { - super(); - } - - public JedisPoolAbstract(GenericObjectPoolConfig poolConfig, PooledObjectFactory factory) { - super(poolConfig, factory); - } - - @Override - protected void returnBrokenResource(Jedis resource) { - super.returnBrokenResource(resource); - } - - @Override - protected void returnResource(Jedis resource) { - super.returnResource(resource); - } -} diff --git a/src/main/java/redis/clients/jedis/JedisSentinelPool.java b/src/main/java/redis/clients/jedis/JedisSentinelPool.java index c6fb037dbb..c1dd5a1cbb 100644 --- a/src/main/java/redis/clients/jedis/JedisSentinelPool.java +++ b/src/main/java/redis/clients/jedis/JedisSentinelPool.java @@ -12,8 +12,9 @@ import redis.clients.jedis.exceptions.JedisConnectionException; import redis.clients.jedis.exceptions.JedisException; +import redis.clients.jedis.util.Pool; -public class JedisSentinelPool extends JedisPoolAbstract { +public class JedisSentinelPool extends Pool { protected GenericObjectPoolConfig poolConfig; @@ -120,11 +121,9 @@ private void initPool(HostAndPort master) { initPool(poolConfig, factory); } else { factory.setHostAndPort(currentHostMaster); - // although we clear the pool, we still have to check the - // returned object - // in getResource, this call only clears idle instances, not - // borrowed instances - internalPool.clear(); + // although we clear the pool, we still have to check the returned object in getResource, + // this call only clears idle instances, not borrowed instances + clear(); } log.info("Created JedisPool to master at " + master); @@ -228,21 +227,21 @@ public Jedis getResource() { } @Override - protected void returnBrokenResource(final Jedis resource) { + public void returnBrokenResource(final Jedis resource) { if (resource != null) { returnBrokenResourceObject(resource); } } @Override - protected void returnResource(final Jedis resource) { + public void returnResource(final Jedis resource) { if (resource != null) { resource.resetState(); returnResourceObject(resource); } } - protected class MasterListener extends Thread { + public class MasterListener extends Thread { protected String masterName; protected String host; diff --git a/src/main/java/redis/clients/jedis/ShardedJedisPool.java b/src/main/java/redis/clients/jedis/ShardedJedisPool.java index a97b494196..53f5ed0838 100644 --- a/src/main/java/redis/clients/jedis/ShardedJedisPool.java +++ b/src/main/java/redis/clients/jedis/ShardedJedisPool.java @@ -39,14 +39,14 @@ public ShardedJedis getResource() { } @Override - protected void returnBrokenResource(final ShardedJedis resource) { + public void returnBrokenResource(final ShardedJedis resource) { if (resource != null) { returnBrokenResourceObject(resource); } } @Override - protected void returnResource(final ShardedJedis resource) { + public void returnResource(final ShardedJedis resource) { if (resource != null) { resource.resetState(); returnResourceObject(resource); diff --git a/src/main/java/redis/clients/jedis/util/Pool.java b/src/main/java/redis/clients/jedis/util/Pool.java index 9ab56c17f3..8e86efb893 100644 --- a/src/main/java/redis/clients/jedis/util/Pool.java +++ b/src/main/java/redis/clients/jedis/util/Pool.java @@ -12,7 +12,7 @@ import redis.clients.jedis.exceptions.JedisExhaustedPoolException; public abstract class Pool implements Closeable { - protected GenericObjectPool internalPool; + private GenericObjectPool internalPool; /** * Using this constructor means you have to set and initialize the internalPool yourself. @@ -45,6 +45,12 @@ public void initPool(final GenericObjectPoolConfig poolConfig, PooledObjectFacto this.internalPool = new GenericObjectPool(factory, poolConfig); } + protected void clear() { + if (internalPool != null) { + internalPool.clear(); + } + } + public T getResource() { try { return internalPool.borrowObject(); @@ -61,9 +67,6 @@ public T getResource() { } protected void returnResourceObject(final T resource) { - if (resource == null) { - return; - } try { internalPool.returnObject(resource); } catch (Exception e) { @@ -71,13 +74,13 @@ protected void returnResourceObject(final T resource) { } } - protected void returnBrokenResource(final T resource) { + public void returnBrokenResource(final T resource) { if (resource != null) { returnBrokenResourceObject(resource); } } - protected void returnResource(final T resource) { + public void returnResource(final T resource) { if (resource != null) { returnResourceObject(resource); } @@ -95,7 +98,7 @@ protected void returnBrokenResourceObject(final T resource) { } } - protected void closeInternalPool() { + private void closeInternalPool() { try { internalPool.close(); } catch (Exception e) { From b8c91abf8482c631cff5d932a94246bc130b3d94 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Sat, 30 Jan 2021 19:22:42 +0600 Subject: [PATCH 2/5] backward compatibility by deprecating JedisPoolAbstract --- src/main/java/redis/clients/jedis/Jedis.java | 2 +- .../java/redis/clients/jedis/JedisPool.java | 3 +-- .../clients/jedis/JedisPoolAbstract.java | 22 +++++++++++++++++++ .../clients/jedis/JedisSentinelPool.java | 7 +++--- .../java/redis/clients/jedis/util/Pool.java | 11 +++++++--- 5 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 src/main/java/redis/clients/jedis/JedisPoolAbstract.java diff --git a/src/main/java/redis/clients/jedis/Jedis.java b/src/main/java/redis/clients/jedis/Jedis.java index bb67cdbe79..b6325123e8 100644 --- a/src/main/java/redis/clients/jedis/Jedis.java +++ b/src/main/java/redis/clients/jedis/Jedis.java @@ -3616,7 +3616,7 @@ public void close() { } } - public void setDataSource(Pool jedisPool) { + public void setDataSource(JedisPoolAbstract jedisPool) { this.dataSource = jedisPool; } diff --git a/src/main/java/redis/clients/jedis/JedisPool.java b/src/main/java/redis/clients/jedis/JedisPool.java index 8ebf8ce592..fb53789113 100644 --- a/src/main/java/redis/clients/jedis/JedisPool.java +++ b/src/main/java/redis/clients/jedis/JedisPool.java @@ -10,9 +10,8 @@ import redis.clients.jedis.exceptions.JedisException; import redis.clients.jedis.util.JedisURIHelper; -import redis.clients.jedis.util.Pool; -public class JedisPool extends Pool { +public class JedisPool extends JedisPoolAbstract { public JedisPool() { this(Protocol.DEFAULT_HOST, Protocol.DEFAULT_PORT); diff --git a/src/main/java/redis/clients/jedis/JedisPoolAbstract.java b/src/main/java/redis/clients/jedis/JedisPoolAbstract.java new file mode 100644 index 0000000000..039424a5af --- /dev/null +++ b/src/main/java/redis/clients/jedis/JedisPoolAbstract.java @@ -0,0 +1,22 @@ +package redis.clients.jedis; + +import org.apache.commons.pool2.PooledObjectFactory; +import org.apache.commons.pool2.impl.GenericObjectPoolConfig; + +import redis.clients.jedis.util.Pool; + +/** + * @deprecated This class will be removed in future. If you are directly manipulating this class, + * you are suggested to change your code to use {@link Pool Pool<Jedis>} instead. + */ +@Deprecated +public class JedisPoolAbstract extends Pool { + + public JedisPoolAbstract() { + super(); + } + + public JedisPoolAbstract(GenericObjectPoolConfig poolConfig, PooledObjectFactory factory) { + super(poolConfig, factory); + } +} diff --git a/src/main/java/redis/clients/jedis/JedisSentinelPool.java b/src/main/java/redis/clients/jedis/JedisSentinelPool.java index 52977529c3..f830c2c24c 100644 --- a/src/main/java/redis/clients/jedis/JedisSentinelPool.java +++ b/src/main/java/redis/clients/jedis/JedisSentinelPool.java @@ -12,9 +12,8 @@ import redis.clients.jedis.exceptions.JedisConnectionException; import redis.clients.jedis.exceptions.JedisException; -import redis.clients.jedis.util.Pool; -public class JedisSentinelPool extends Pool { +public class JedisSentinelPool extends JedisPoolAbstract { protected Logger log = LoggerFactory.getLogger(getClass().getName()); protected final GenericObjectPoolConfig poolConfig; @@ -200,7 +199,7 @@ private void initPool(HostAndPort master) { factory.setHostAndPort(currentHostMaster); // although we clear the pool, we still have to check the returned object in getResource, // this call only clears idle instances, not borrowed instances - clear(); + clearInternalPool(); } log.info("Created JedisPool to master at {}", master); @@ -330,7 +329,7 @@ public void returnResource(final Jedis resource) { } } - public class MasterListener extends Thread { + protected class MasterListener extends Thread { protected String masterName; protected String host; diff --git a/src/main/java/redis/clients/jedis/util/Pool.java b/src/main/java/redis/clients/jedis/util/Pool.java index a66ca0478b..30deaa9055 100644 --- a/src/main/java/redis/clients/jedis/util/Pool.java +++ b/src/main/java/redis/clients/jedis/util/Pool.java @@ -12,7 +12,12 @@ import redis.clients.jedis.exceptions.JedisExhaustedPoolException; public abstract class Pool implements Closeable { - private GenericObjectPool internalPool; + + /** + * @deprecated This will be private in future; + */ + @Deprecated + protected GenericObjectPool internalPool; /** * Using this constructor means you have to set and initialize the internalPool yourself. @@ -45,7 +50,7 @@ public void initPool(final GenericObjectPoolConfig poolConfig, PooledObjectFacto this.internalPool = new GenericObjectPool<>(factory, poolConfig); } - protected void clear() { + protected void clearInternalPool() { if (internalPool != null) { internalPool.clear(); } @@ -98,7 +103,7 @@ protected void returnBrokenResourceObject(final T resource) { } } - private void closeInternalPool() { + protected void closeInternalPool() { try { internalPool.close(); } catch (Exception e) { From 443d066db213a2958ed53ea8dcd2b8344aac5928 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Sun, 7 Feb 2021 16:12:37 +0600 Subject: [PATCH 3/5] backward compatibility and deprecated --- src/main/java/redis/clients/jedis/Jedis.java | 6 +++++- src/main/java/redis/clients/jedis/util/Pool.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/redis/clients/jedis/Jedis.java b/src/main/java/redis/clients/jedis/Jedis.java index b6325123e8..5f745d9704 100644 --- a/src/main/java/redis/clients/jedis/Jedis.java +++ b/src/main/java/redis/clients/jedis/Jedis.java @@ -36,7 +36,11 @@ public class Jedis extends BinaryJedis implements JedisCommands, MultiKeyCommands, AdvancedJedisCommands, ScriptingCommands, BasicCommands, ClusterCommands, SentinelCommands, ModuleCommands { - private Pool dataSource = null; + /** + * @deprecated This will be private in future. + */ + @Deprecated + protected Pool dataSource = null; public Jedis() { super(); diff --git a/src/main/java/redis/clients/jedis/util/Pool.java b/src/main/java/redis/clients/jedis/util/Pool.java index 30deaa9055..b72f584141 100644 --- a/src/main/java/redis/clients/jedis/util/Pool.java +++ b/src/main/java/redis/clients/jedis/util/Pool.java @@ -14,7 +14,7 @@ public abstract class Pool implements Closeable { /** - * @deprecated This will be private in future; + * @deprecated This will be private in future. */ @Deprecated protected GenericObjectPool internalPool; From cf794fc1c94221ee2d51600a43c9569650b01d81 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Sun, 7 Feb 2021 16:28:37 +0600 Subject: [PATCH 4/5] added logs and removed unnecessary repeated codes --- src/main/java/redis/clients/jedis/Jedis.java | 5 ++--- src/main/java/redis/clients/jedis/JedisPool.java | 14 +++++--------- .../redis/clients/jedis/JedisSentinelPool.java | 16 +++++++--------- .../redis/clients/jedis/ShardedJedisPool.java | 7 ------- 4 files changed, 14 insertions(+), 28 deletions(-) diff --git a/src/main/java/redis/clients/jedis/Jedis.java b/src/main/java/redis/clients/jedis/Jedis.java index 5f745d9704..e605484ac9 100644 --- a/src/main/java/redis/clients/jedis/Jedis.java +++ b/src/main/java/redis/clients/jedis/Jedis.java @@ -29,7 +29,6 @@ import redis.clients.jedis.params.ZAddParams; import redis.clients.jedis.params.ZIncrByParams; import redis.clients.jedis.params.LPosParams; -import redis.clients.jedis.util.Pool; import redis.clients.jedis.util.SafeEncoder; import redis.clients.jedis.util.Slowlog; @@ -40,7 +39,7 @@ public class Jedis extends BinaryJedis implements JedisCommands, MultiKeyCommand * @deprecated This will be private in future. */ @Deprecated - protected Pool dataSource = null; + protected JedisPoolAbstract dataSource = null; public Jedis() { super(); @@ -3608,7 +3607,7 @@ public Map pubsubNumSub(String... channels) { @Override public void close() { if (dataSource != null) { - Pool pool = this.dataSource; + JedisPoolAbstract pool = this.dataSource; this.dataSource = null; if (client.isBroken()) { pool.returnBrokenResource(this); diff --git a/src/main/java/redis/clients/jedis/JedisPool.java b/src/main/java/redis/clients/jedis/JedisPool.java index fb53789113..d7f9bdbb40 100644 --- a/src/main/java/redis/clients/jedis/JedisPool.java +++ b/src/main/java/redis/clients/jedis/JedisPool.java @@ -1,18 +1,20 @@ package redis.clients.jedis; import java.net.URI; - import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLSocketFactory; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import redis.clients.jedis.exceptions.JedisException; import redis.clients.jedis.util.JedisURIHelper; public class JedisPool extends JedisPoolAbstract { + private static final Logger log = LoggerFactory.getLogger(JedisPool.class); + public JedisPool() { this(Protocol.DEFAULT_HOST, Protocol.DEFAULT_PORT); } @@ -329,13 +331,6 @@ public Jedis getResource() { return jedis; } - @Override - public void returnBrokenResource(final Jedis resource) { - if (resource != null) { - returnBrokenResourceObject(resource); - } - } - @Override public void returnResource(final Jedis resource) { if (resource != null) { @@ -344,6 +339,7 @@ public void returnResource(final Jedis resource) { returnResourceObject(resource); } catch (Exception e) { returnBrokenResource(resource); + log.debug("Resource is returned to the pool as broken", e); } } } diff --git a/src/main/java/redis/clients/jedis/JedisSentinelPool.java b/src/main/java/redis/clients/jedis/JedisSentinelPool.java index f830c2c24c..768b3da0c4 100644 --- a/src/main/java/redis/clients/jedis/JedisSentinelPool.java +++ b/src/main/java/redis/clients/jedis/JedisSentinelPool.java @@ -14,7 +14,12 @@ import redis.clients.jedis.exceptions.JedisException; public class JedisSentinelPool extends JedisPoolAbstract { - protected Logger log = LoggerFactory.getLogger(getClass().getName()); + + /** + * @deprecated This will be private in future. + */ + @Deprecated + protected static Logger log = LoggerFactory.getLogger(JedisSentinelPool.class); protected final GenericObjectPoolConfig poolConfig; @@ -309,13 +314,6 @@ public Jedis getResource() { } } - @Override - public void returnBrokenResource(final Jedis resource) { - if (resource != null) { - returnBrokenResourceObject(resource); - } - } - @Override public void returnResource(final Jedis resource) { if (resource != null) { @@ -324,7 +322,7 @@ public void returnResource(final Jedis resource) { returnResourceObject(resource); } catch (Exception e) { returnBrokenResource(resource); - throw new JedisException("Resource is returned to the pool as broken", e); + log.debug("Resource is returned to the pool as broken", e); } } } diff --git a/src/main/java/redis/clients/jedis/ShardedJedisPool.java b/src/main/java/redis/clients/jedis/ShardedJedisPool.java index 89c671ec52..81e01b122a 100644 --- a/src/main/java/redis/clients/jedis/ShardedJedisPool.java +++ b/src/main/java/redis/clients/jedis/ShardedJedisPool.java @@ -38,13 +38,6 @@ public ShardedJedis getResource() { return jedis; } - @Override - public void returnBrokenResource(final ShardedJedis resource) { - if (resource != null) { - returnBrokenResourceObject(resource); - } - } - @Override public void returnResource(final ShardedJedis resource) { if (resource != null) { From 065218373b0724b030fe80da7e1a30377b6dc5d6 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Sun, 7 Feb 2021 17:48:18 +0600 Subject: [PATCH 5/5] Update src/main/java/redis/clients/jedis/JedisPool.java --- src/main/java/redis/clients/jedis/JedisPool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/redis/clients/jedis/JedisPool.java b/src/main/java/redis/clients/jedis/JedisPool.java index d7f9bdbb40..608fc34284 100644 --- a/src/main/java/redis/clients/jedis/JedisPool.java +++ b/src/main/java/redis/clients/jedis/JedisPool.java @@ -339,7 +339,7 @@ public void returnResource(final Jedis resource) { returnResourceObject(resource); } catch (Exception e) { returnBrokenResource(resource); - log.debug("Resource is returned to the pool as broken", e); + log.warn("Resource is returned to the pool as broken", e); } } }