liubao68 commented on code in PR #4486:
URL:
https://github.com/apache/servicecomb-java-chassis/pull/4486#discussion_r1740298416
##########
clients/http-client-common/src/main/java/org/apache/servicecomb/http/client/common/AbstractAddressManager.java:
##########
@@ -175,27 +161,34 @@ protected String formatAddress(String address) {
}
}
- private String getDefaultAddress() {
- List<String> addresses = getAvailableAddress(defaultAddress);
- if (!addresses.isEmpty()) {
- return getCurrentAddress(addresses);
+ protected String getUrlPrefix(String address) {
+ return address + V3_PREFIX;
+ }
+
+ public String address() {
+ if (!addressAutoRefreshed) {
+ return getDefaultAddress();
+ } else {
+ return getAvailableZoneAddress();
}
- return getInitAddress();
}
- private String getAvailableZoneAddress() {
- List<String> addresses = getAvailableZoneIpPorts();
+ private String getDefaultAddress() {
if (!addresses.isEmpty()) {
return getCurrentAddress(addresses);
}
- return getInitAddress();
+ LOGGER.warn("all address is isolation, please check server status.");
+ // when all addresses is isolation, it will use all addresses for polling.
+ return getCurrentAddress(new ArrayList<>(addressCategory));
}
- // when all available address is fail, it will use all the initial addresses
for polling.
- private String getInitAddress() {
- if (addresses.isEmpty()) {
- return null;
+ private String getAvailableZoneAddress() {
+ List<String> zoneOrRegionAddress = getZoneOrRegionAddress();
+ if (!zoneOrRegionAddress.isEmpty()) {
+ return getCurrentAddress(zoneOrRegionAddress);
}
+ LOGGER.warn("all auto discovery address is isolation, please check server
status.");
Review Comment:
Refer to above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]