You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/15 01:59:21 UTC

[GitHub] [dubbo] haoxz11 commented on a diff in pull request #10937: Fix the warning problem when invokerUrls is checked

haoxz11 commented on code in PR #10937:
URL: https://github.com/apache/dubbo/pull/10937#discussion_r1022239874


##########
dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java:
##########
@@ -231,14 +231,14 @@ private void refreshInvoker(List<URL> invokerUrls) {
             }
             // use local reference to avoid NPE as this.cachedInvokerUrls will be set null by destroyAllInvokers().
             Set<URL> localCachedInvokerUrls = this.cachedInvokerUrls;
-            if (invokerUrls.isEmpty() && localCachedInvokerUrls != null) {
-
-                // 1-4 Empty address.
-                logger.warn(REGISTRY_EMPTY_ADDRESS, "configuration ", "",
-                    "Service" + serviceKey + " received empty address list with no EMPTY protocol set, trigger empty protection.");
-
-                invokerUrls.addAll(localCachedInvokerUrls);
+            if (invokerUrls.isEmpty()) {
+                if(localCachedInvokerUrls != null){
+                    // 1-4 Empty address.

Review Comment:
   > 这个修改从代码编译后的效果上来看是一样的
   
   ![image](https://user-images.githubusercontent.com/16596043/201807631-2fd923ba-dcd6-4b83-98fc-fc49722d1fd1.png)
   
   ![image](https://user-images.githubusercontent.com/16596043/201807800-eb744914-e6f9-4a8b-a82f-35c3b7d2dc16.png)
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org