-
Notifications
You must be signed in to change notification settings - Fork 814
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
Add catch all panic handler in dex endblock #1196
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1196 +/- ##
==========================================
- Coverage 63.83% 63.38% -0.45%
==========================================
Files 257 257
Lines 16672 16690 +18
==========================================
- Hits 10642 10579 -63
- Misses 5526 5603 +77
- Partials 504 508 +4
|
Can we add a metric for panicHandler so that we can monitor and alert on it? |
@@ -130,16 +129,17 @@ func ExecutePairsInParallel(ctx sdk.Context, contractAddr string, dexkeeper *kee | |||
cancelResults := []*types.Cancellation{} | |||
settlements := []*types.SettlementEntry{} | |||
|
|||
mu := sync.Mutex{} | |||
wg := sync.WaitGroup{} | |||
// mu := sync.Mutex{} |
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.
We leave them here so that we can revert them in case we need?
* Add catch all panic handler in dex endblock * test * Add a new counter metric for recovered panics --------- Co-authored-by: yzang2019 <[email protected]>
Describe your changes and provide context
Any panic in EndBlock would cause the chain to halt, so we decide to add back panic recovery handler. Also made executions for multiple pairs sequential for each contract so that panics are easier to manage.
After this fix, there will be:
EndBlock
function, the main goroutine, with a panic handler at https://github.com/sei-protocol/sei-chain/compare/fix-dex?expand=1#diff-f32c70484252fadec70cda9a6ad7888fd568f6afffb3750bb9621090e2ac88bbR307Testing performed to validate your change
Tested locally by reproducing the reported bug POC