[ISSUE #11526] Update ServiceInfoHolder.java, add log output in processServiceInfo (#11527)

* Update ServiceInfoHolder.java, add log output in processServiceInfo

* Update ServiceInfoHolder.java, add log output in processServiceInfo
This commit is contained in:
MajorHe1 2024-01-05 17:56:08 +08:00 committed by GitHub
parent ea94095f74
commit dbb1b65fcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,11 +123,15 @@ public class ServiceInfoHolder implements Closeable {
public ServiceInfo processServiceInfo(ServiceInfo serviceInfo) {
String serviceKey = serviceInfo.getKey();
if (serviceKey == null) {
NAMING_LOGGER.warn("process service info but serviceKey is null, service host: {}",
JacksonUtils.toJson(serviceInfo.getHosts()));
return null;
}
ServiceInfo oldService = serviceInfoMap.get(serviceInfo.getKey());
if (isEmptyOrErrorPush(serviceInfo)) {
//empty or error push, just ignore
NAMING_LOGGER.warn("process service info but found empty or error push, serviceKey: {}, "
+ "pushEmptyProtection: {}, hosts: {}", serviceKey, pushEmptyProtection, serviceInfo.getHosts());
return oldService;
}
serviceInfoMap.put(serviceInfo.getKey(), serviceInfo);