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

SpringCloud+feign服务调用,参与方抛异常,发起方不回滚 #438

Open
suntyan opened this issue Sep 5, 2019 · 1 comment
Open

Comments

@suntyan
Copy link

@suntyan suntyan commented Sep 5, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

1. Bug Description

SpringCloud+feign服务调用,参与方不回滚。例如:发起方A(注解使用的是@LcnTransaction,@transactional)
)通过feign调用参与方B(注解@LcnTransaction(propagation = DTXPropagation.SUPPORTS)
@transactional),B抛异常,A插入数据(不回滚)。
使用过的解决办法:
1,feign取消falback,不进行熔断,测试无效;
2,feign不取消falback,进行熔断,在添加方法的实现加入DTXUserControls.rollbackGroup(TracingContext.tracing().groupId()),测试无效;

生产环境:
腾讯云
使用Docker打txlcn的镜像,TM主机IP设置为:0.0.0.0:8070(无法设置为127.0.0.1:8070,否则TC绑定不到TM主机)
服务A配置TC主机IP为:TM主机的负载均衡IP:8070,开启了LCN的重写负载策略
服务B配置TC主机IP为:TM主机的负载均衡IP:8070,开启了LCN的重写负载策略

部署txlcn镜像日志显示:
An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.io.IOException: 连接被对方重设
不知是否影响?

TxManager系统后台:
已注册的TC=2(也就是A和B已绑定TM)

一切看起来很正常,正确使用了参与方与发起方的注解,但是,B服务抛出异常,曾经试过取消熔断把异常抛给A服务与加入DTXUserControls.rollbackGroup(TracingContext.tracing().groupId())代码,A服务依旧提交了事务?

请解答,万分感谢。

2. Environment:

  • JDK version:1.8
  • OS:
  • TX-LCN version:5.02
  • Others:

3. Exception Stacktrace

Paste your Exception Stacktrace here!

4. Tour Idea

@suntyan suntyan changed the title SpringCloud+feign服务调用,参与方不回滚 SpringCloud+feign服务调用,参与方抛异常,发起方不回滚 Sep 5, 2019
@yuntao1997
Copy link

@yuntao1997 yuntao1997 commented Dec 25, 2019

#481

我的解决步骤,或许能帮助到你

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.