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/11/18 12:09:54 UTC
[dubbo] branch master updated: [master] revert AbstractConfiguratorListener#genConfiguratorsFromRawRule (#9249)
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 e05494d [master] revert AbstractConfiguratorListener#genConfiguratorsFromRawRule (#9249)
e05494d is described below
commit e05494dea846bfea60727b1e5135efed2ffbf6b1
Author: zrlw <zr...@sina.com>
AuthorDate: Thu Nov 18 20:09:45 2021 +0800
[master] revert AbstractConfiguratorListener#genConfiguratorsFromRawRule (#9249)
* ignore event content parse failure
* support single ip
* revert genConfiguratorsFromRawRule
---
.../registry/integration/AbstractConfiguratorListener.java | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/AbstractConfiguratorListener.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/AbstractConfiguratorListener.java
index 3f3b2c7..13e8527 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/AbstractConfiguratorListener.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/AbstractConfiguratorListener.java
@@ -60,11 +60,10 @@ public abstract class AbstractConfiguratorListener implements ConfigurationListe
", raw config content is:\n " + event.getContent());
}
- if (event.getChangeType().equals(ConfigChangeType.ADDED)) {
- return;
- } else if (event.getChangeType().equals(ConfigChangeType.DELETED)) {
+ if (event.getChangeType().equals(ConfigChangeType.DELETED)) {
configurators.clear();
} else {
+ // ADDED or MODIFIED
if (!genConfiguratorsFromRawRule(event.getContent())) {
return;
}
@@ -74,17 +73,16 @@ public abstract class AbstractConfiguratorListener implements ConfigurationListe
}
private boolean genConfiguratorsFromRawRule(String rawConfig) {
- boolean parseSuccess = true;
try {
// parseConfigurators will recognize app/service config automatically.
configurators = Configurator.toConfigurators(ConfigParser.parseConfigurators(rawConfig))
.orElse(configurators);
} catch (Exception e) {
- logger.error("Failed to parse raw dynamic config and it will not take effect, the raw config is: " +
- rawConfig, e);
- parseSuccess = false;
+ logger.warn("Failed to parse raw dynamic config and it will not take effect, the raw config is: "
+ + rawConfig + ", cause: " + e.getMessage());
+ return false;
}
- return parseSuccess;
+ return true;
}
protected abstract void notifyOverrides();