8000 Registering instance should update valid (health) by nanamikon · Pull Request #823 · alibaba/nacos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Registering instance should update valid (health) #823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions naming/src/main/java/com/alibaba/nacos/naming/core/Cluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ public void updateIPs(List<IpAddress> ips) {
if (responsible(ip)) {
// do not update the ip validation status of updated ips
// because the checker has the most precise result

// Only when ip is not marked, don't we update the health status of IP:
if (!ip.isMarked()) {
ip.setValid(oldIP.isValid());
if (((VirtualClusterDomain)dom).getEnableHealthCheck() || ((VirtualClusterDomain)dom).getEnableClientBeat()) {
// Only when ip is not marked, don't we update the health status of IP:
if (!ip.isMarked()) {
ip.setValid(oldIP.isValid());
}
}

} else {
if (ip.isValid() != oldIP.isValid()) {
// ip validation status updated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,13 +526,15 @@ private IpAddress getIPAddress(HttpServletRequest request) {
cluster = WebUtils.optional(request, "clusterName", UtilsAndCommons.DEFAULT_CLUSTER_NAME);
}
boolean enabled = BooleanUtils.toBoolean(WebUtils.optional(request, "enable", "true"));
boolean valid = BooleanUtils.toBoolean(WebUtils.optional(request, "valid", "true"));

IpAddress ipAddress = new IpAddress();
ipAddress.setPort(Integer.parseInt(port));
ipAddress.setIp(ip);
ipAddress.setWeight(Double.parseDouble(weight));
ipAddress.setClusterName(cluster);
ipAddress.setEnabled(enabled);
ipAddress.setValid(valid);

if (!ipAddress.validate()) {
throw new IllegalArgumentException("malfomed ip config: " + ipAddress);
Expand Down
0