Skip to content
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

[ISSUE #12301] 相同永久实例在不同nameSpace下面健康检测问题 #12310

Merged
merged 1 commit into from
Jul 31, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.alibaba.nacos.naming.core.v2.pojo;

import com.alibaba.nacos.api.common.Constants;
import com.alibaba.nacos.api.naming.utils.NamingUtils;

import java.io.Serializable;
Expand Down Expand Up @@ -95,6 +96,11 @@ public void incrementRevision() {
public String getGroupedServiceName() {
return NamingUtils.getGroupedName(name, group);
}

public String getNameSpaceGroupedServiceName() {
//do not String.intern
return namespace + Constants.SERVICE_INFO_SPLITER + NamingUtils.getGroupedName(name, group);
}

@Override
public boolean equals(Object o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void process(HealthCheckTaskV2 task, Service service, ClusterMetadata met
// TODO handle marked(white list) logic like v1.x.
if (!instance.tryStartCheck()) {
SRV_LOG.warn("[HEALTH-CHECK-V2] tcp check started before last one finished, service: {} : {} : {}:{}",
service.getGroupedServiceName(), instance.getCluster(), instance.getIp(), instance.getPort());
service.getNameSpaceGroupedServiceName(), instance.getCluster(), instance.getIp(), instance.getPort());
healthCheckCommon
.reEvaluateCheckRT(task.getCheckRtNormalized() * 2, task, switchDomain.getTcpHealthParams());
return;
Expand Down Expand Up @@ -287,7 +287,7 @@ public void finishCheck(boolean success, boolean now, long rt, String msg) {

@Override
public String toString() {
return service.getGroupedServiceName() + ":" + instance.getCluster() + ":" + instance.getIp() + ":"
return service.getNameSpaceGroupedServiceName() + ":" + instance.getCluster() + ":" + instance.getIp() + ":"
+ instance.getPort();
}

Expand Down
Loading