|
|
|
@ -153,30 +153,16 @@ public class LoadBalancerManager {
|
|
|
|
|
private AtomicBoolean initConnError = new AtomicBoolean(false);
|
|
|
|
|
@Override
|
|
|
|
|
public void accept(Void r, Throwable ex) {
|
|
|
|
|
synchronized (this) {
|
|
|
|
|
if (ex == null) {
|
|
|
|
|
listener.decCounter();
|
|
|
|
|
} else {
|
|
|
|
|
if (!initConnError.compareAndSet(false, true)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
for (RedisConnection connection : entry.getAllConnections()) {
|
|
|
|
|
if (!connection.isClosed()) {
|
|
|
|
|
connection.closeAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
entry.getAllConnections().clear();
|
|
|
|
|
|
|
|
|
|
for (RedisConnection connection : entry.getAllSubscribeConnections()) {
|
|
|
|
|
if (!connection.isClosed()) {
|
|
|
|
|
connection.closeAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
entry.getAllSubscribeConnections().clear();
|
|
|
|
|
entry.closeAllConnections();
|
|
|
|
|
entry.setInitialized(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
entry.resetFirstFail();
|
|
|
|
|
slaveConnectionPool.initConnections(entry).onComplete(initCallBack);
|
|
|
|
|