Fixed - Redisson.shutdown blocks calling thread. #2306

pull/2323/head
Nikita Koksharov 5 years ago
parent 9e9fdfe884
commit 0487fd9c40

@ -311,13 +311,6 @@ public final class RedisClient {
}
public RFuture<Void> shutdownAsync() {
for (Channel channel : channels) {
RedisConnection connection = RedisConnection.getFrom(channel);
if (connection != null) {
connection.closeAsync();
}
}
final RPromise<Void> result = new RedissonPromise<Void>();
ChannelGroupFuture channelsFuture = channels.newCloseFuture();
channelsFuture.addListener(new FutureListener<Void>() {
@ -364,6 +357,13 @@ public final class RedisClient {
}
});
for (Channel channel : channels) {
RedisConnection connection = RedisConnection.getFrom(channel);
if (connection != null) {
connection.closeAsync();
}
}
return result;
}

@ -255,11 +255,9 @@ public class RedisConnection implements RedisCommands {
if (command != null && command.isBlockingCommand()) {
channel.close();
} else {
RFuture<Void> f = async(RedisCommands.QUIT);
RFuture<Void> f = async(redisClient.getConfig().getCommandTimeout(), RedisCommands.QUIT);
f.onComplete((res, e) -> {
if (e != null) {
channel.close();
}
channel.close();
});
}
}

Loading…
Cancel
Save