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: optimize transaction timeout judgment #777

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Road2Melon
Copy link

@Road2Melon Road2Melon commented Feb 17, 2025

What this PR does:
In the seata-java, there's a pull request : optimize: optimize transaction timeout judgment apache/incubator-seata#4445

Problem Description: When the Transaction Manager (TM) initiates a transaction commit to the Transaction Coordinator (TC), the TC returns a status of TimeoutRollbacking but does not throw an exception. This leads the TM to believe the transaction was successfully committed, while in reality, the TC has instructed each Resource Manager (RM) to perform a rollback.

Solution: The TM side introduces a timer to calculate the time difference between the transaction commit and the begin phases. If this time difference exceeds the timeout, the TM will roll back the transaction; otherwise, it will proceed with the commit.

Which issue(s) this PR fixes:

Fixes #698

Special notes for your reviewer:
I created two test cases to simulate two scenarios: normal and abnormal rollback when TM detects timeout
Does this PR introduce a user-facing change?:


@Road2Melon Road2Melon changed the title optimize: optimize transaction timeout judgment (#698) optimize: optimize transaction timeout judgment Feb 18, 2025
@Road2Melon
Copy link
Author

The CI issue also occurred in # 770, and it may have been fixed in # 776, but the code in # 776 has not been merged yet. Should I follow the code in # 776 to make changes or wait for # 776 to merge?

@Code-Fight
Copy link
Contributor

The CI issue also occurred in # 770, and it may have been fixed in # 776, but the code in # 776 has not been merged yet. Should I follow the code in # 776 to make changes or wait for # 776 to merge?

I saw this PR, I’ll merge #770, no need for this one anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[seata-java] 事务提交返回TimeoutRollbacking未抛异常
3 participants