diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/v2/pojo/Service.java b/naming/src/main/java/com/alibaba/nacos/naming/core/v2/pojo/Service.java index 93971aff0..711edd80c 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/v2/pojo/Service.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/v2/pojo/Service.java @@ -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; @@ -95,6 +96,11 @@ public class Service implements Serializable { 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) { diff --git a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/v2/processor/TcpHealthCheckProcessor.java b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/v2/processor/TcpHealthCheckProcessor.java index 36e39b083..c9994cb3e 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/v2/processor/TcpHealthCheckProcessor.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/v2/processor/TcpHealthCheckProcessor.java @@ -102,7 +102,7 @@ public class TcpHealthCheckProcessor implements HealthCheckProcessorV2, Runnable // 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; @@ -287,7 +287,7 @@ public class TcpHealthCheckProcessor implements HealthCheckProcessorV2, Runnable @Override public String toString() { - return service.getGroupedServiceName() + ":" + instance.getCluster() + ":" + instance.getIp() + ":" + return service.getNameSpaceGroupedServiceName() + ":" + instance.getCluster() + ":" + instance.getIp() + ":" + instance.getPort(); }