This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.1 by this push:
     new aff1ee6f0d Fix instance revision check (#11314)
aff1ee6f0d is described below

commit aff1ee6f0d84b89e985d9af0669aa6c6287bf05f
Author: Albumen Kevin <[email protected]>
AuthorDate: Mon Jan 16 20:59:50 2023 +0800

    Fix instance revision check (#11314)
---
 .../org/apache/dubbo/registry/client/AbstractServiceDiscovery.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/AbstractServiceDiscovery.java
 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/AbstractServiceDiscovery.java
index d3431d77e9..6241fe1778 100644
--- 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/AbstractServiceDiscovery.java
+++ 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/AbstractServiceDiscovery.java
@@ -309,8 +309,9 @@ public abstract class AbstractServiceDiscovery implements 
ServiceDiscovery {
     protected void doUpdate(ServiceInstance oldServiceInstance, 
ServiceInstance newServiceInstance) {
         this.doUnregister(oldServiceInstance);
 
-        if 
(!EMPTY_REVISION.equals(getExportedServicesRevision(serviceInstance))) {
-            this.serviceInstance = newServiceInstance;
+        this.serviceInstance = newServiceInstance;
+
+        if 
(!EMPTY_REVISION.equals(getExportedServicesRevision(newServiceInstance))) {
             reportMetadata(newServiceInstance.getServiceMetadata());
             this.doRegister(newServiceInstance);
         }

Reply via email to