Added a JUnit test for JedisSentinelPool.
This test will set up and get a master from a Redis master slave pair being watched by 2 Sentinels. It pings the master, segfaults it, asks the pool for another connection and makes sure it can ping it. This commit also restores the pom.xml file's scm information back to xetorthio and adds the default Sentinel port to the Procotol.
This commit is contained in:
@@ -231,9 +231,13 @@ public class JedisSentinelPool extends Pool<Jedis> {
|
||||
}, "+switch-master");
|
||||
|
||||
} catch (JedisConnectionException e) {
|
||||
log.severe("Lost connection to Sentinel at " + host + ":" + port + ". Sleeping 5000ms and retrying.");
|
||||
|
||||
try { Thread.sleep(subscribeRetryWaitTimeMillis); } catch (InterruptedException e1) { e1.printStackTrace(); }
|
||||
if (running.get()) {
|
||||
log.severe("Lost connection to Sentinel at " + host + ":" + port + ". Sleeping 5000ms and retrying.");
|
||||
try { Thread.sleep(subscribeRetryWaitTimeMillis); } catch (InterruptedException e1) { e1.printStackTrace(); }
|
||||
} else {
|
||||
log.fine("Unsubscribing from Sentinel at " + host + ":" + port);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import redis.clients.util.SafeEncoder;
|
||||
public final class Protocol {
|
||||
|
||||
public static final int DEFAULT_PORT = 6379;
|
||||
public static final int DEFAULT_SENTINEL_PORT = 26379;
|
||||
public static final int DEFAULT_TIMEOUT = 2000;
|
||||
public static final int DEFAULT_DATABASE = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user