|
|
@ -46,11 +46,11 @@ import org.redisson.config.BaseMasterSlaveServersConfig;
|
|
|
|
import org.redisson.config.Config;
|
|
|
|
import org.redisson.config.Config;
|
|
|
|
import org.redisson.config.MasterSlaveServersConfig;
|
|
|
|
import org.redisson.config.MasterSlaveServersConfig;
|
|
|
|
import org.redisson.config.TransportMode;
|
|
|
|
import org.redisson.config.TransportMode;
|
|
|
|
|
|
|
|
import org.redisson.misc.CountableListener;
|
|
|
|
import org.redisson.misc.InfinitySemaphoreLatch;
|
|
|
|
import org.redisson.misc.InfinitySemaphoreLatch;
|
|
|
|
import org.redisson.misc.RPromise;
|
|
|
|
import org.redisson.misc.RPromise;
|
|
|
|
import org.redisson.misc.RedissonPromise;
|
|
|
|
import org.redisson.misc.RedissonPromise;
|
|
|
|
import org.redisson.misc.URIBuilder;
|
|
|
|
import org.redisson.misc.URIBuilder;
|
|
|
|
import org.redisson.pubsub.AsyncSemaphore;
|
|
|
|
|
|
|
|
import org.redisson.pubsub.PublishSubscribeService;
|
|
|
|
import org.redisson.pubsub.PublishSubscribeService;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
@ -435,11 +435,6 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
|
|
|
|
return client;
|
|
|
|
return client;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void shutdownAsync(RedisClient client) {
|
|
|
|
|
|
|
|
client.shutdownAsync();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public RedisClient createClient(NodeType type, URI address, int timeout, int commandTimeout, String sslHostname) {
|
|
|
|
public RedisClient createClient(NodeType type, URI address, int timeout, int commandTimeout, String sslHostname) {
|
|
|
|
RedisClientConfig redisConfig = createRedisConfig(type, address, timeout, commandTimeout, sslHostname);
|
|
|
|
RedisClientConfig redisConfig = createRedisConfig(type, address, timeout, commandTimeout, sslHostname);
|
|
|
@ -632,16 +627,7 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
|
|
|
|
if (dnsMonitor != null) {
|
|
|
|
if (dnsMonitor != null) {
|
|
|
|
dnsMonitor.stop();
|
|
|
|
dnsMonitor.stop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resolverGroup.close();
|
|
|
|
timer.stop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
shutdownLatch.close();
|
|
|
|
|
|
|
|
shutdownPromise.trySuccess(true);
|
|
|
|
|
|
|
|
shutdownLatch.awaitUninterruptibly();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (MasterSlaveEntry entry : getEntrySet()) {
|
|
|
|
|
|
|
|
entry.shutdown();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (cfg.getExecutor() == null) {
|
|
|
|
if (cfg.getExecutor() == null) {
|
|
|
|
executor.shutdown();
|
|
|
|
executor.shutdown();
|
|
|
@ -652,7 +638,19 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
resolverGroup.close();
|
|
|
|
timer.stop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
shutdownLatch.close();
|
|
|
|
|
|
|
|
shutdownPromise.trySuccess(true);
|
|
|
|
|
|
|
|
shutdownLatch.awaitUninterruptibly();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RPromise<Void> result = new RedissonPromise<Void>();
|
|
|
|
|
|
|
|
CountableListener<Void> listener = new CountableListener<Void>(result, null, getEntrySet().size());
|
|
|
|
|
|
|
|
for (MasterSlaveEntry entry : getEntrySet()) {
|
|
|
|
|
|
|
|
entry.shutdownAsync().addListener(listener);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.awaitUninterruptibly(timeout, unit);
|
|
|
|
|
|
|
|
|
|
|
|
if (cfg.getEventLoopGroup() == null) {
|
|
|
|
if (cfg.getEventLoopGroup() == null) {
|
|
|
|
group.shutdownGracefully(quietPeriod, timeout, unit).syncUninterruptibly();
|
|
|
|
group.shutdownGracefully(quietPeriod, timeout, unit).syncUninterruptibly();
|
|
|
|