apache / apache/incubator-seata
SagaError serializer failed:class feign.FeignException$InternalServerError
- Dominant language
- Java
- Stars
- 26k
- Forks
- 8.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 4
Description
- [x] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.
### Ⅰ. Issue Description
用seata1.3.0的SAGA模式进行事务管理,状态机捕获异常后序列化异常时报错,导致没有执行补偿方法,回滚失败。
### Ⅱ. Describe what happened
io.seata.saga.engine.serializer.impl.ExceptionSerializer.serializeByObjectOutput(ExceptionSerializer.java:48)[userMessage=serializer failed: calss feign.FeignException$InternalServerError]
java.io.NotSerializableException: feign.Request
at java .io.ObjectOutputStream.writeObjectO
.......
### Ⅲ. Describe what you expected to happen
配置好服务和状态机以后,正向执行没问题。
在测试补偿的时候,自己在事务B抛了个RuntimeException。测试开始事务A正常,通过feign调用微服务执行事务B。此时微服务报500,状态机判定事务B的State[Deduct] finish with [UN],并且catch到我抛出的RuntimeException,下一步应该是执行CompenstationTrigger,执行补偿方法才对。但是跟代码发现还没到执行方法前一直在序列化事务B抛出的500错误信息,然后就抛出上面的异常信息了。然后点进去看,feign包里的确有个public final calss Request没有继承序列化接口,我用的feign版本是 10.7.4
官方给出的demo是dubbo的,请问目前1.3.0版本的Saga支持feign调用么?
是否应该更换feign版本或者是我哪里配错了
希望大佬们给点思路
### Ⅳ. How to reproduce it (as minimally and precisely as possible)
### Ⅴ. Anything else we need to know?
### Ⅵ. Environment:
- JDK version :1.8
- OS :windows
- Others:springcloud+feign+consul+oracle
Contributor guide
Research direction
Start at io.seata.saga.engine.serializer.impl.ExceptionSerializer.java:48 and inspect how FeignException$InternalServerError and its feign.Request are serialized during Saga compensation. Reproduce the Spring Cloud Feign flow described with Seata 1.3.0, JDK 8, and Feign 10.7.4, then verify whether compensation reaches CompenstationTrigger without a serialization failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100