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

Seata TCC模式下commit方法和rollback方法branchType缺失 #7186

Open
Yang-xingchen opened this issue Feb 26, 2025 · 4 comments
Open

Seata TCC模式下commit方法和rollback方法branchType缺失 #7186

Yang-xingchen opened this issue Feb 26, 2025 · 4 comments

Comments

@Yang-xingchen
Copy link

Ⅰ. Issue Description

在使用TCC模式下时,调用到commit方法和rollback方法时,方法内BusinessActionContext.getBranchType()得到内容为null。

Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. 接口使用@LocalTCC注解
  2. prepare方法使用@TwoPhaseBusinessAction注解,
  3. prepare方法、commit方法、rollback方法第一个参数均为BusinessActionContext
  4. prepare方法可以正常获取到branchType为TCC,commit方法和rollback方法获取branchType为null

Minimal yet complete reproducer code (or URL to code):

Ⅴ. Anything else we need to know?

目前调试发现在org.apache.seata.rm.tcc.TCCResourceManager中branchCommit方法和branchRollback方法参数中有branchType值且取值正常,但方法体中未使用该值(包括创建BusinessActionContext对象)。
当前代码仓库中也未使用该值TCCResourceManager

Ⅵ. Environment:

  • JDK version(e.g. java -version): 21
  • Seata client/server version: client: 2.1.0 server: 2.2.0
  • Database version: 未使用
  • OS(e.g. uname -a): Linux zk1 5.18.15-1.el7.elrepo.x86_64 fescar init #1 SMP PREEMPT_DYNAMIC Thu Jul 28 09:26:15 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux
  • Others:
@funky-eyes
Copy link
Contributor

I suspect this is a bug. Could you submit a PR to fix this issue?

@YongGoose
Copy link
Contributor

@Yang-xingchen
If you’re busy and don’t have time, I’d be happy to take on this issue :)

@Yang-xingchen
Copy link
Author

@YongGoose ok,I am still learning Seata and not very familiar with it yet. You can fix it.

@YongGoose
Copy link
Contributor

@YongGoose ok,I am still learning Seata and not very familiar with it yet. You can fix it.

Thanks!

I’ll reach out if I need any help while working on the issue. 🙂

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

No branches or pull requests

3 participants