Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceConfig initialized not changed to false once subscribe throws exception #PR:4067 #4068

Closed
2 tasks done
haiyang1985 opened this issue May 15, 2019 · 0 comments
Closed
2 tasks done
Milestone

Comments

@haiyang1985
Copy link
Member

haiyang1985 commented May 15, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.1
  • Operating System version: mac sierra 10.12
  • Java version: 1.8

Steps to reproduce this issue

For PR: #4067

  1. Run consumer without provider as below, it throws No provider exception.
ReferenceConfigCache cache = ReferenceConfigCache.getCache();
DemoService demoService = (DemoService) cache.get(reference);
demoService.sayHello("hi");
  1. Start provider and then run consumer again, get null from the demoService.
ReferenceConfigCache cache = ReferenceConfigCache.getCache();
DemoService demoService = (DemoService) cache.get(reference);

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

DemoService should be initialized.

Actual Result

DemoService returns null even with provider started.

For the first time, the ReferenceConfig init throws exception from refprotocol.refer(interfaceClass, urls.get(0)), have not changed the initialized to false. For the second time, the ReferenceConfig cannot init it again as initialized is true.

We should set initialized after init finished.

@beiwei30 beiwei30 added this to the 2.7.2 milestone May 17, 2019
@haiyang1985 haiyang1985 changed the title ReferenceConfig initialized not changed to false once subscribe throws exception ReferenceConfig initialized not changed to false once subscribe throws exception #PR:4067 May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants