You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/05/31 12:05:58 UTC

[dubbo] branch master updated: the forbidden change to false must depend on invokerUrls isNotEmpty. (#7270)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3f671c3  the forbidden change to false must depend on invokerUrls isNotEmpty. (#7270)
3f671c3 is described below

commit 3f671c3e54de08b810e48f71ba60c3778dda56eb
Author: 赵延 <10...@qq.com>
AuthorDate: Mon May 31 20:05:40 2021 +0800

    the forbidden change to false must depend on invokerUrls isNotEmpty. (#7270)
---
 .../java/org/apache/dubbo/registry/integration/RegistryDirectory.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
index a0bd837..9323667 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
@@ -173,7 +173,6 @@ public class RegistryDirectory<T> extends DynamicDirectory<T> {
             routerChain.setInvokers(this.invokers);
             destroyAllInvokers(); // Close all invokers
         } else {
-            this.forbidden = false; // Allow to access
             Map<URL, Invoker<T>> oldUrlInvokerMap = this.urlInvokerMap; // local reference
             if (invokerUrls == Collections.<URL>emptyList()) {
                 invokerUrls = new ArrayList<>();
@@ -187,6 +186,7 @@ public class RegistryDirectory<T> extends DynamicDirectory<T> {
             if (invokerUrls.isEmpty()) {
                 return;
             }
+            this.forbidden = false; // Allow to access
             Map<URL, Invoker<T>> newUrlInvokerMap = toInvokers(invokerUrls);// Translate url list to Invoker map
 
             /**