-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
bugfix: add three tcc fence interceptors to fix tcc fence deadlock ex… #6706
base: 2.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/home/runner/work/incubator-seata/incubator-seata/spring/src/main/java/org/apache/seata/spring/annotation/GlobalTransactionScanner.java:20: Using the '.' form of import should be avoided - java.util.. [AvoidStarImport]
/** | ||
* The constant KEY_RESOURCE_ID. | ||
*/ | ||
public static final String KEY_RESOURCE_ID = "TX_RESOURCE_ID"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rootcontext不应该用来存放这些数据
Rootcontext should not be used to store this data
@@ -42,6 +34,14 @@ | |||
import org.slf4j.LoggerFactory; | |||
import org.slf4j.MDC; | |||
|
|||
import javax.annotation.Nonnull; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
java的包应该在顶层
Java packages should be at the top level
import org.springframework.transaction.support.TransactionTemplate; | ||
|
||
import javax.sql.DataSource; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
ditto
* @param targetInterceptorClass the target interceptor class | ||
* @return boolean | ||
*/ | ||
public static boolean hasTransactionAspectBeforeInterceptor(Method method, Object proxy, Class<?> targetInterceptorClass) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么不在代理bean的时候就初始化好一切信息?
Why not initialize everything in the proxy bean?
…ever/incubator-seata into clever_fix_tcc_deadlock_v2
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #6706 +/- ##
============================================
- Coverage 50.02% 49.66% -0.37%
Complexity 5734 5734
============================================
Files 1051 1055 +4
Lines 36340 36643 +303
Branches 4321 4369 +48
============================================
+ Hits 18179 18198 +19
- Misses 16365 16645 +280
- Partials 1796 1800 +4
|
* @param bean bean | ||
* @throws Exception | ||
*/ | ||
private static void addTccFenceAdvisorsForBean(Object bean) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么要增加这个方法?
Why add this method?
@@ -121,6 +122,10 @@ public BranchStatus branchCommit(BranchType branchType, String xid, long branchI | |||
Object[] args = this.getTwoPhaseCommitArgs(tccResource, businessActionContext); | |||
Object ret; | |||
boolean result; | |||
RootContext.bind(xid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
二阶段为什么要使用rootcontext?
Why use rootcontext in Phase 2?
…ception (#6679)
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
fixes #6679
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews