Skip to content

Commit

Permalink
Merge pull request #3135 from beiwei30:registry-refresh-redo, avoid d…
Browse files Browse the repository at this point in the history
…up refresh for registry config.

* avoid dup refresh for registry config

* fix unit test

* fix unit test, org.apache.dubbo.config.AbstractInterfaceConfig#convertRegistryIdsToRegistries generates invalid registry config

* should not give RegistryConfig a default value 'RegistryConfig.NO_AVAILABLE'
  • Loading branch information
beiwei30 authored and chickenlj committed Jan 6, 2019
1 parent 5c971c1 commit ec8a5b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ protected void checkMetadataReport() {
*/
protected List<URL> loadRegistries(boolean provider) {
// check && override if necessary
checkRegistry();
List<URL> registryList = new ArrayList<URL>();
if (registries != null && !registries.isEmpty()) {
for (RegistryConfig config : registries) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public void checkAndUpdateSubConfigs() {
inheritIfAbsentFromApplication();
}
checkApplication();
checkRegistry();
checkMetadataReport();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public void checkApplication2() throws Exception {
public void testLoadRegistries() throws Exception {
System.setProperty("dubbo.registry.address", "addr1");
InterfaceConfig interfaceConfig = new InterfaceConfig();
// FIXME: now we need to check first, then load
interfaceConfig.checkRegistry();
List<URL> urls = interfaceConfig.loadRegistries(true);
TestCase.assertEquals(1, urls.size());
URL url = urls.get(0);
Expand Down

0 comments on commit ec8a5b9

Please sign in to comment.