incubator-seata
incubator-seata copied to clipboard
optimize: Prohibit registration of TCC resources with the same name
- [ ] I have registered the PR changes.
Ⅰ. Describe what this PR did
Check when registering TCC resources, if a resource with the same name already exists, determine if it is a parent-child relationship, if not, prevent the application from starting by throwing an exception.
注册TCC资源时进行检查,如果已经存在相同名称的资源,判断是否是父子类关系,如果不是,通过抛出异常的方式阻止应用启动
Ⅱ. Does this pull request fix one issue?
https://github.com/seata/seata/issues/6088
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
Codecov Report
Merging #6091 (f6d5517) into 2.x (5563492) will decrease coverage by
0.03%
. The diff coverage is29.16%
.
Additional details and impacted files
@@ Coverage Diff @@
## 2.x #6091 +/- ##
============================================
- Coverage 48.94% 48.91% -0.03%
- Complexity 4775 4779 +4
============================================
Files 913 914 +1
Lines 31710 31728 +18
Branches 3827 3829 +2
============================================
Hits 15521 15521
- Misses 14653 14661 +8
- Partials 1536 1546 +10
Files | Coverage Δ | |
---|---|---|
.../common/exception/RepeatRegistrationException.java | 0.00% <0.00%> (ø) |
|
.../main/java/io/seata/rm/tcc/TCCResourceManager.java | 15.00% <38.88%> (+3.23%) |
:arrow_up: |
please resolve conflicts
From the perspective of internal practical experience, share my suggestions:
- The resource name should be globally unique.
- Annotations to the interface, do not allow multiple implementation classes, single responsibility.
你的意思是将定义TCC资源的注解直接移动到接口上而不是某个方法上吗? Do you mean moving the annotations defining the TCC resources directly to the interface instead of to a method?
LGTM
LGTM
There are some conflicting files, please fix.
Codecov Report
Attention: 17 lines
in your changes are missing coverage. Please review.
Comparison is base (
e590de5
) 48.95% compared to head (852f05c
) 48.98%.
Additional details and impacted files
@@ Coverage Diff @@
## 2.x #6091 +/- ##
============================================
+ Coverage 48.95% 48.98% +0.02%
- Complexity 4778 4781 +3
============================================
Files 915 916 +1
Lines 31892 31910 +18
Branches 3853 3855 +2
============================================
+ Hits 15613 15631 +18
+ Misses 14720 14718 -2
- Partials 1559 1561 +2
Files | Coverage Δ | |
---|---|---|
.../common/exception/RepeatRegistrationException.java | 0.00% <0.00%> (ø) |
|
.../main/java/io/seata/rm/tcc/TCCResourceManager.java | 15.00% <38.88%> (+3.23%) |
:arrow_up: |
There are some conflicting files, please fix.
Thanks for the heads up, I have resolved the conflict
I can't merge this pr due to another conflict, please fix it.