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 <ken.lj...@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(); }); }