You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/12/03 08:36:16 UTC

[dubbo] branch duplicate-global-config-check created (now 5e9a9cf)

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

liujun pushed a change to branch duplicate-global-config-check
in repository https://gitbox.apache.org/repos/asf/dubbo.git.


      at 5e9a9cf  log warn msg for duplicate global configs

This branch includes the following new commits:

     new 5e9a9cf  log warn msg for duplicate global configs

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[dubbo] 01/01: log warn msg for duplicate global configs

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch duplicate-global-config-check
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit 5e9a9cffea3d82a974e4fb472d1c61b0ed65cbc1
Author: ken.lj <ke...@gmail.com>
AuthorDate: Tue Dec 3 16:35:30 2019 +0800

    log warn msg for duplicate global configs
---
 .../main/java/org/apache/dubbo/config/context/ConfigManager.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/config/context/ConfigManager.java b/dubbo-common/src/main/java/org/apache/dubbo/config/context/ConfigManager.java
index a49876d..296e604 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/config/context/ConfigManager.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/config/context/ConfigManager.java
@@ -400,10 +400,10 @@ public class ConfigManager extends LifecycleAdapter implements FrameworkExt {
 //                throw new IllegalStateException("No such " + configType.getName() + " is found");
                 return null;
             } else if (size > 1) {
-                throw new IllegalStateException("The expected single matching " + configType + " but found " + size + " instances");
-            } else {
-                return configsMap.values().iterator().next();
+                logger.warn("Expected single matching of " + configType + ", but found " + size + " instances, will randomly pick the first one.");
             }
+
+            return configsMap.values().iterator().next();
         });
     }