apache / apache/incubator-seata
关于Feign降级导致seata服务不能回滚问题
- Dominant language
- Java
- Stars
- 26k
- Forks
- 8.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 4
Description
- [ ] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.
### Ⅰ. Issue Description
#2088
参考了上面这个问题的相关做法,但还是有问题:
假如现在有a、b、c三个服务,在a服务里顺序调用b、c服务,b、c服务都配置了降级方法,并且在降级方法里配置了回滚:GlobalTransactionContext.reload(RootContext.getXID()).rollback();
@wangwei-ying
现在是在调用b服务时超时了,可能是因为异常信息被feign处理掉了,seata感知不到,这时会继续调用c服务,但是在c服务里面尝试获取全局事务ID:RootContext.getXID(); 是获取不到的,感觉是没注册到,所以就导致c服务里面的事务自己本地提交了,而a、b服务的事务都回滚了
### Ⅱ. Describe what happened
```
```
### Ⅲ. Describe what you expected to happen
有什么办法能让c服务不被继续调用到,或者能让c服务的事务被回滚呢?
### Ⅳ. How to reproduce it (as minimally and precisely as possible)
### Ⅴ. Anything else we need to know?
### Ⅵ. Environment:
- JDK version :1.8
- OS :windoes 10
- Others: seata1.1.0
Contributor guide
Research direction
Start with the Feign fallback flow described for services a, b, and c, and inspect how RootContext.getXID() and GlobalTransactionContext.reload(...).rollback() behave in Seata 1.1.0. Reproduce the timeout when b is called from a, then verify whether c is invoked without a global transaction and whether its local transaction commits. Done means the failure and a reliable way to prevent c or roll it back are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100