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

feature:Transfer global timeout and branch transaction begin time #7164

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

xiaoxiangyeyu0
Copy link
Contributor

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

XA模式用到的全局超时时间没有使用单独配置,需要传递全局超时时间和分支事务开始时间
The global timeout time used in the XA Mode is not configured separately, and the global timeout time and branch transaction start time need to be passed.

Ⅱ. Does this pull request fix one issue?

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@xiaoxiangyeyu0 xiaoxiangyeyu0 changed the title bugfix:Transfer global timeout and branch transaction begin time feature:Transfer global timeout and branch transaction begin time Feb 13, 2025
Comment on lines +116 to +117
RootContext.setTimeout(timeout);
RootContext.setBranchBeignTime(createTime);
Copy link
Contributor

Choose a reason for hiding this comment

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

integration模块中需要传递两个值
Two values need to be passed in the integration module

transactionTimeout = DefaultValues.DEFAULT_GLOBAL_TRANSACTION_TIMEOUT;
}
timeout = Math.max(BRANCH_EXECUTION_TIMEOUT, transactionTimeout);
branchBeginTime = RootContext.getBranchBeignTime();
Copy link
Member

Choose a reason for hiding this comment

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

I don't see this branchBeginTime value being passed from the downstream service, and if it's not passed, it's no different from the previous function. Or what you're trying to say is timeout is the timeout of a branch transaction not the timeout of a global transaction?

@@ -113,6 +113,8 @@ public void begin(int timeout, String name) throws TransactionException {
xid = transactionManager.begin(null, null, name, timeout);
status = GlobalStatus.Begin;
RootContext.bind(xid);
RootContext.setTimeout(timeout);
RootContext.setBranchBeignTime(createTime);
Copy link
Member

Choose a reason for hiding this comment

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

If I set this value here I think it is ambiguous, the time here should be the start time of the global transaction and not the begin time of the branch transaction.

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

Successfully merging this pull request may close these issues.

3 participants