Skip to content

Commit

Permalink
[ISSUE #11526] Update ServiceInfoHolder.java, add log output in proce…
Browse files Browse the repository at this point in the history
…ssServiceInfo (#11527)

* Update ServiceInfoHolder.java, add log output in processServiceInfo

* Update ServiceInfoHolder.java, add log output in processServiceInfo
  • Loading branch information
MajorHe1 authored Jan 5, 2024
1 parent ea94095 commit dbb1b65
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,15 @@ public ServiceInfo processServiceInfo(String json) {
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);
Expand Down

0 comments on commit dbb1b65

Please sign in to comment.