* [ISSUE #8709] check serverList size before reconnect to server * use CollectionUtils.isEmpty to judge whether server list is empty Co-authored-by: Oliver <wqdyxnbd@163.com> Co-authored-by: Oliver <wqdyxnbd@163.com>
This commit is contained in:
parent
7bb1e90549
commit
68b521679c
@ -91,7 +91,7 @@ public class HttpLoginProcessor implements LoginProcessor {
|
||||
}
|
||||
return loginIdentityContext;
|
||||
} catch (Exception e) {
|
||||
SECURITY_LOGGER.error("[ NacosClientAuthServiceImpl] login http request failed"
|
||||
SECURITY_LOGGER.error("[NacosClientAuthServiceImpl] login http request failed"
|
||||
+ " url: {}, params: {}, bodyMap: {}, errorMsg: {}", url, params, bodyMap, e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
@ -665,7 +665,7 @@ public class ClientWorker implements Closeable {
|
||||
|
||||
@Override
|
||||
public List<String> getServerList() {
|
||||
return ConfigRpcTransportClient.super.serverListManager.serverUrls;
|
||||
return ConfigRpcTransportClient.super.serverListManager.getServerUrls();
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -551,6 +551,10 @@ public abstract class RpcClient implements Closeable {
|
||||
recommendServer.set(null);
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(RpcClient.this.serverListFactory.getServerList())) {
|
||||
throw new Exception("server list is empty");
|
||||
}
|
||||
|
||||
if (reConnectTimes > 0
|
||||
&& reConnectTimes % RpcClient.this.serverListFactory.getServerList().size() == 0) {
|
||||
LoggerUtils.printIfInfoEnabled(LOGGER,
|
||||
|
Loading…
Reference in New Issue
Block a user