apache / apache/incubator-seata
saga-status-unexpect:it inter the fail branch,the status is unknown
- 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
### Ⅱ. Describe what happened
If there is an exception, please attach the exception trace:
```
It inter the fail branch,my json file have compensate method,then the status become unknown,i will post the picture and json file below.
```
the json file
```
{
"Name": "soldAuditChoiceStateMachine",
"Comment": "已定审核带分支的状态机定义",
"StartState": "FirstState",
"Version": "0.0.5",
"States": {
"FirstState": {
"Type": "ServiceTask",
"ServiceName": "submitSoldSagaManager",
"ServiceMethod": "getOrderInfoByTradeId",
"Next": "ChoiceState",
"Input": ["$.[soldInfoReq].tradeId"],
"Output": {
"tradeOrderResp": "$.#root"
}
},
"ChoiceState":{
"Type": "Choice",
"Choices":[
{
"Expression":"[tradeOrderResp]!=null && [tradeOrderResp].orderType == 13",
"Next":"SecondState"
}
],
"Default":"ThirdState"
},
"SecondState": {
"Type": "ServiceTask",
"ServiceName": "submitSoldSagaManager",
"ServiceMethod": "soldAudit",
"CompensateState": "CompensateSoldAudit",
"Next": "ResultState",
"Input": ["$.[soldInfoReq]"],
"Output": {
"dResult": "$.#root"
},
"Catch": [
{
"Exceptions": [
"java.lang.RuntimeException"
],
"Next": "CompensationTrigger"
}
]
},
"ThirdState": {
"Type": "ServiceTask",
"ServiceName": "submitSoldSagaManager",
"ServiceMethod": "submitSoldAudit",
"CompensateState": "CompensateSubmitSoldAudit",
"Next": "ResultState",
"Input": ["$.[soldInfoReq]"],
"Output": {
"dResult": "$.#root"
},
"Catch": [
{
"Exceptions": [
"java.lang.RuntimeException"
],
"Next": "CompensationTrigger"
}
]
},
"CompensateSoldAudit": {
"Type": "ServiceTask",
"ServiceName": "submitSoldSagaManager",
"ServiceMethod": "compensateSoldAudit",
"Input": [
{
"compensateInput": "$.[soldInfoReq]",
"throwException": "$.[exception]"
}
]
},
"CompensateSubmitSoldAudit": {
"Type": "ServiceTask",
"ServiceName": "submitSoldSagaManager",
"ServiceMethod": "compensateSubmitSoldAudit",
"Input": [
{
"compensateInput": "$.[soldInfoReq]",
"throwException": "$.[exception]"
}
]
},
"CompensationTrigger": {
"Type": "CompensationTrigger",
"Next": "Fail"
},
"ResultState":{
"Type": "Choice",
"Choices":[
{
"Expression":"[dResult].code == 0",
"Next":"Succeed"
}
],
"Default":"Fail"
},
"Succeed": {
"Type":"Succeed"
},
"Fail": {
"Type":"Fail",
"ErrorCode": "NOT_FOUND",
"Message": "not found"
}
}
}
```
the stateMachine status:

Contributor guide
Research direction
Start by reproducing the reported saga execution with the supplied state-machine JSON, including the fail branch, Catch handlers, CompensationTrigger, and compensation methods. Trace how the state-machine status is recorded after failure and compensation; done means the resulting status is no longer incorrectly reported as unknown.
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
- 30/100