-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
optimize: add saga statelang semantic validation #5928
optimize: add saga statelang semantic validation #5928
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 2.x #5928 +/- ##
============================================
- Coverage 49.78% 48.96% -0.82%
+ Complexity 4545 4524 -21
============================================
Files 854 846 -8
Lines 29883 28904 -979
Branches 3660 3619 -41
============================================
- Hits 14877 14154 -723
+ Misses 13516 13275 -241
+ Partials 1490 1475 -15
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job.
1.Rule is implemented by SPI
2. Abstract verification rules
3. Implement common rules
@ptyin add change in 2.0.0.md. |
done |
Ⅰ. Describe what this PR did
To avoid throwing exception in Saga runtime, I added Saga statelang semantic validation phase. Validation rules include:
FiniteTerminationRule
: Rule to check if the state machine can terminate in finite time, i.e. if there is an infinite loop.NoRecursiveSubStateMachineRule
: Rule to check if all SubStateMachines has no recursive call.StateNameExistsRule
: Rule to check if all the state names exist.Users can add more validation rules using SPI.
Ⅱ. Does this pull request fix one issue?
Related to #5904
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
Notes for
FiniteTerminationRule
: the main idea is to find all cycles in the graph. And if there is a cycle without outgoing flow, it means the state machine can definitely not stop.FiniteTerminationRule
的备注:核心思想是找到图中的所有环。如果有任何一个环没有连向非环的出边,则意味着状态机肯定不能停止。