diff --git a/src/main/java/redis/clients/jedis/JedisSentinelPool.java b/src/main/java/redis/clients/jedis/JedisSentinelPool.java index f4ecab10a6..28c7c944e2 100644 --- a/src/main/java/redis/clients/jedis/JedisSentinelPool.java +++ b/src/main/java/redis/clients/jedis/JedisSentinelPool.java @@ -202,7 +202,7 @@ private void initMasterListeners(Set sentinels, String masterName) private void initMasterListeners(Set sentinels, String masterName, GenericObjectPoolConfig poolConfig) { - LOG.info("Init master node listener {}", masterName); + LOG.info("Starting Sentinel listeners for {}...", masterName); SentinelPoolConfig jedisSentinelPoolConfig = null; if (poolConfig instanceof SentinelPoolConfig) { jedisSentinelPoolConfig = ((SentinelPoolConfig) poolConfig); @@ -232,7 +232,6 @@ public void onChange(HostAndPort hostAndPort) { }); } } - masterListeners.forEach(SentinelMasterListener::start); } diff --git a/src/main/java/redis/clients/jedis/SentinelMasterActiveDetectListener.java b/src/main/java/redis/clients/jedis/SentinelMasterActiveDetectListener.java index 3dca23d304..bfe50ff44f 100644 --- a/src/main/java/redis/clients/jedis/SentinelMasterActiveDetectListener.java +++ b/src/main/java/redis/clients/jedis/SentinelMasterActiveDetectListener.java @@ -36,6 +36,7 @@ public SentinelMasterActiveDetectListener(HostAndPort currentHostMaster, HostAnd this.jedisClientConfig = jedisClientConfig; this.masterName = masterName; this.activeDetectIntervalTimeMillis = activeDetectIntervalTimeMillis; + this.setDaemon(true); } @Override diff --git a/src/main/java/redis/clients/jedis/SentinelMasterSubscribeListener.java b/src/main/java/redis/clients/jedis/SentinelMasterSubscribeListener.java index 71917e7d1b..dd2d32fbfe 100644 --- a/src/main/java/redis/clients/jedis/SentinelMasterSubscribeListener.java +++ b/src/main/java/redis/clients/jedis/SentinelMasterSubscribeListener.java @@ -33,6 +33,7 @@ public SentinelMasterSubscribeListener(String masterName, HostAndPort sentinel, this.sentinel = sentinel; this.sentinelClientConfig = sentinelClientConfig; this.subscribeRetryWaitTimeMillis = subscribeRetryWaitTimeMillis; + this.setDaemon(true); } @Override