-
Notifications
You must be signed in to change notification settings - Fork 92
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 retry loop to block handler. #823
Conversation
How about creating 2 dedicated connections for block import? ( |
I think this is still useful as a basic safety net, but your idea is even better. Another possible issue is that Aurora replication (presumably) needs its own connection handle(s). One suspicion is this is why our mobile wallet deployments fall behind from time to time. To resolve that one we might need to make the pgx pool size configurable. Seems like ConnectConfig has plenty of options for doing that. |
I'm just not sure ignoring an error is a good solution. Not following about aurora replication. |
It doesn't ignore the error. An error is logged, it's up to the service runner to decide whether or not to ignore errors.
I can follow up on this separately. |
Codecov Report
@@ Coverage Diff @@
## develop #823 +/- ##
===========================================
- Coverage 59.17% 57.49% -1.68%
===========================================
Files 32 35 +3
Lines 4108 4327 +219
===========================================
+ Hits 2431 2488 +57
- Misses 1379 1539 +160
- Partials 298 300 +2
Continue to review full report at Codecov.
|
@tolikzinovyev I created some followup tickets to reduce the chance that this will happen: |
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.
looks fine.
3e4bbe0
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.
Looks good!
Summary
If the Postgres database handles are exhausted due to many pending queries, block import will fail. With the existing code that would cause Indexer to terminate.
This PR adds a retry loop to ensure the process eventually recover after this sort of transient failure.
Test Plan
New unit test.