DATAREDIS-1127 - Handling ping failures for getSentinelConnection method.
Original Pull Request: #524
This commit is contained in:
committed by
Christoph Strobl
parent
254d60e820
commit
964c55959a
@@ -75,6 +75,7 @@ import org.springframework.util.CollectionUtils;
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
* @author Fu Jian
|
||||
* @author Ajith Kumar
|
||||
* @see JedisClientConfiguration
|
||||
* @see Jedis
|
||||
*/
|
||||
@@ -855,10 +856,14 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean,
|
||||
|
||||
Jedis jedis = new Jedis(node.getHost(), node.getPort(), getConnectTimeout(), getReadTimeout());
|
||||
|
||||
if (jedis.ping().equalsIgnoreCase("pong")) {
|
||||
try {
|
||||
if (jedis.ping().equalsIgnoreCase("pong")) {
|
||||
|
||||
potentiallySetClientName(jedis);
|
||||
return jedis;
|
||||
potentiallySetClientName(jedis);
|
||||
return jedis;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.warn(String.format("Ping failed for sentinel host:%s", node.getHost()), ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user