Skip to content

Commit 8646277

Browse files
haiyang1985ralf0131
authored andcommitted
reference config initialized. (#4067)
1 parent 8456a11 commit 8646277

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ private void init() {
273273
if (initialized) {
274274
return;
275275
}
276-
initialized = true;
277276
checkStubAndLocal(interfaceClass);
278277
checkMock(interfaceClass);
279278
Map<String, String> map = new HashMap<String, String>();
@@ -331,6 +330,7 @@ private void init() {
331330

332331
String serviceKey = URL.buildKey(interfaceName, group, version);
333332
ApplicationModel.initConsumerModel(serviceKey, buildConsumerModel(serviceKey, attributes));
333+
initialized = true;
334334
}
335335

336336
private ConsumerModel buildConsumerModel(String serviceKey, Map<String, Object> attributes) {
@@ -414,8 +414,6 @@ private T createProxy(Map<String, String> map) {
414414
}
415415

416416
if (shouldCheck() && !invoker.isAvailable()) {
417-
// make it possible for consumer to retry later if provider is temporarily unavailable
418-
initialized = false;
419417
throw new IllegalStateException("Failed to check the status of the service " + interfaceName + ". No provider available for the service " + (group == null ? "" : group + "/") + interfaceName + (version == null ? "" : ":" + version) + " from the url " + invoker.getUrl() + " to the consumer " + NetUtils.getLocalHost() + " use dubbo version " + Version.getVersion());
420418
}
421419
if (logger.isInfoEnabled()) {

0 commit comments

Comments
 (0)