From dbb1b65fcb4fbad267298d1d096e3f94a910973f Mon Sep 17 00:00:00 2001 From: MajorHe1 <53824889+MajorHe1@users.noreply.github.com> Date: Fri, 5 Jan 2024 17:56:08 +0800 Subject: [PATCH] [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 --- .../alibaba/nacos/client/naming/cache/ServiceInfoHolder.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/cache/ServiceInfoHolder.java b/client/src/main/java/com/alibaba/nacos/client/naming/cache/ServiceInfoHolder.java index 74b1bb5d2d9..264b7e8da88 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/cache/ServiceInfoHolder.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/cache/ServiceInfoHolder.java @@ -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);