Skip to content

Commit

Permalink
修改: Fix 12301。 (alibaba#12310)
Browse files Browse the repository at this point in the history
  • Loading branch information
chen10038 authored Jul 31, 2024
1 parent 48a0f8b commit 525f3bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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

0 comments on commit 525f3bf

Please sign in to comment.