From 9ce5501b8d50410a79eda33695fb1dd394a87bf1 Mon Sep 17 00:00:00 2001 From: JackSun-Developer Date: Fri, 5 Feb 2021 09:16:13 +0800 Subject: [PATCH] [ISSUE #3876][NA] failed to update serviceName: DEFAULT_GROUP@@prod-zipkin (#4864) --- .../nacos/naming/controllers/InstanceController.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java index 5746b2f7d..798f3f1ad 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java @@ -102,6 +102,16 @@ public class InstanceController { client.getClusters(), client.getSocketAddr().getAddress().getHostAddress(), 0, StringUtils.EMPTY, false, StringUtils.EMPTY, StringUtils.EMPTY, false); } catch (Exception e) { + String serviceNameField = "name"; + String lastRefTimeField = "lastRefTime"; + if (result.get(serviceNameField) == null) { + String serviceName = client.getServiceName(); + if (serviceName == null) { + serviceName = StringUtils.trimToEmpty(serviceName); + } + result.put(serviceNameField, serviceName); + result.put(lastRefTimeField, System.currentTimeMillis()); + } Loggers.SRV_LOG.warn("PUSH-SERVICE: service is not modified", e); }