SpringCloud+feign服务调用,参与方抛异常,发起方不回滚
- Lenguaje dominante
- Java
- Estrellas
- 4.2k
- Forks
- 1.4k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
- [ ] I have searched the [issues](https://github.com/codingapi/tx-lcn/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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Start by reproducing the A-to-B Feign call with the stated @LcnTransaction and @Transactional annotations under TX-LCN 5.02. Review the fallback behavior, TC/TM configuration, and the reported connection-reset log. Done means identifying why B's exception does not roll back A and documenting a confirmed fix or actionable diagnosis.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, spring
- Área
- backend, distributed-systems
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100