修改: Fix 12301。 (#12310)

This commit is contained in:
chen10038 2024-07-31 13:47:59 +08:00 committed by GitHub
parent 48a0f8b0fb
commit 525f3bf43f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -16,6 +16,7 @@
package com.alibaba.nacos.naming.core.v2.pojo; package com.alibaba.nacos.naming.core.v2.pojo;
import com.alibaba.nacos.api.common.Constants;
import com.alibaba.nacos.api.naming.utils.NamingUtils; import com.alibaba.nacos.api.naming.utils.NamingUtils;
import java.io.Serializable; import java.io.Serializable;
@ -95,6 +96,11 @@ public class Service implements Serializable {
public String getGroupedServiceName() { public String getGroupedServiceName() {
return NamingUtils.getGroupedName(name, group); return NamingUtils.getGroupedName(name, group);
} }
public String getNameSpaceGroupedServiceName() {
//do not String.intern
return namespace + Constants.SERVICE_INFO_SPLITER + NamingUtils.getGroupedName(name, group);
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {

View File

@ -102,7 +102,7 @@ public class TcpHealthCheckProcessor implements HealthCheckProcessorV2, Runnable
// TODO handle marked(white list) logic like v1.x. // TODO handle marked(white list) logic like v1.x.
if (!instance.tryStartCheck()) { if (!instance.tryStartCheck()) {
SRV_LOG.warn("[HEALTH-CHECK-V2] tcp check started before last one finished, service: {} : {} : {}:{}", 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 healthCheckCommon
.reEvaluateCheckRT(task.getCheckRtNormalized() * 2, task, switchDomain.getTcpHealthParams()); .reEvaluateCheckRT(task.getCheckRtNormalized() * 2, task, switchDomain.getTcpHealthParams());
return; return;
@ -287,7 +287,7 @@ public class TcpHealthCheckProcessor implements HealthCheckProcessorV2, Runnable
@Override @Override
public String toString() { public String toString() {
return service.getGroupedServiceName() + ":" + instance.getCluster() + ":" + instance.getIp() + ":" return service.getNameSpaceGroupedServiceName() + ":" + instance.getCluster() + ":" + instance.getIp() + ":"
+ instance.getPort(); + instance.getPort();
} }