From 5f875ea9581373eb720ff5335db72c5b4cf7c3b3 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Mon, 19 Jun 2023 09:33:36 +0800 Subject: [PATCH] Fix Registry Notification use same event time (#12556) --- .../java/org/apache/dubbo/registry/RegistryNotifier.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/RegistryNotifier.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/RegistryNotifier.java index 168368690a..fe9296b8e3 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/RegistryNotifier.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/RegistryNotifier.java @@ -77,6 +77,14 @@ public abstract class RegistryNotifier { } scheduler.submit(new NotificationTask(this, notifyTime)); } + try { + while (this.lastEventTime == System.currentTimeMillis()) { + // wait to let event time refresh + Thread.sleep(1); + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } } public long getDelayTime() {