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

optimize:the property bean may not be initialized while reading config value #3316

Merged
merged 9 commits into from
Dec 29, 2020
Merged

Conversation

xingfudeshi
Copy link
Member

Ⅰ. Describe what this PR did

The property bean may not be initialized while reading config value,so it will cause timeout problem while connecting registry center.like Consul.This PR did a optimization for the problem.

Ⅱ. Does this pull request fix one issue?

fixes #3006

Ⅲ. Why don't you add test cases (unit test/integration test)?

Unit test provided.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@funky-eyes funky-eyes added the module/seata-spring-boot-starter seata-spring-boot-starter module label Dec 13, 2020
Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov-io
Copy link

codecov-io commented Dec 25, 2020

Codecov Report

Merging #3316 (0d3cfd0) into develop (08fbcef) will increase coverage by 0.16%.
The diff coverage is 93.18%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3316      +/-   ##
=============================================
+ Coverage      51.56%   51.73%   +0.16%     
- Complexity      3341     3347       +6     
=============================================
  Files            616      617       +1     
  Lines          20243    20254      +11     
  Branches        2541     2541              
=============================================
+ Hits           10439    10478      +39     
+ Misses          8752     8724      -28     
  Partials        1052     1052              
Impacted Files Coverage Δ Complexity Δ
...ing/boot/autoconfigure/SeataAutoConfiguration.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...gure/provider/SpringBootConfigurationProvider.java 60.71% <96.87%> (+21.82%) 8.00 <0.00> (ø)
.../boot/autoconfigure/PropertyBeanPostProcessor.java 100.00% <100.00%> (ø) 5.00 <5.00> (?)
...ta/spring/boot/autoconfigure/StarterConstants.java 100.00% <100.00%> (ø) 1.00 <1.00> (ø)
...n/src/main/java/io/seata/common/util/IdWorker.java 77.08% <0.00%> (-6.25%) 11.00% <0.00%> (-1.00%)
...boot/autoconfigure/properties/SeataProperties.java 54.83% <0.00%> (+9.67%) 9.00% <0.00%> (+2.00%)

@wangliang181230
Copy link
Contributor

I think it's better to get the configuration directly from the Environment in the springboot project.

@xingfudeshi
Copy link
Member Author

xingfudeshi commented Dec 28, 2020

I think it's better to get the configuration directly from the Environment in the springboot project.

What if the environment variables of Seata conflict with those of other software?

Copy link
Contributor

@wangliang181230 wangliang181230 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wangliang181230
Copy link
Contributor

wangliang181230 commented Dec 29, 2020

I think it's better to get the configuration directly from the Environment in the springboot project.

What if the environment variables of Seata conflict with those of other software?

If configuration conflict is considered, all components integrated with springboot will have a headache. Therefore, this issue is generally not considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/seata-spring-boot-starter seata-spring-boot-starter module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

registry,config 使用consul,报错:config operation timeout,cost:5002ms,op:GET,
5 participants