-
Notifications
You must be signed in to change notification settings - Fork 51
Switch to client-side GRPC retry interceptor #917
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
Conversation
3b18b74 to
b92241f
Compare
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.
Pull Request Overview
This PR replaces the native gRPC retry mechanism with a custom client-side retry interceptor to address issues where Flow public access nodes instruct clients not to retry despite having resources available. The implementation includes comprehensive logging and error handling improvements.
Key Changes:
- Implemented custom gRPC retry interceptor with exponential backoff in
utils/grpc.go - Updated all gRPC client instantiations to use the new retry interceptor
- Enhanced error handling by changing
NewEmulatorServerto return errors instead of nil
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/grpc.go | Replaced service config constant with client-side retry interceptor implementation |
| storage/remote/store.go | Updated to use new retry interceptor instead of service config |
| storage/checkpoint/checkpoint_test.go | Changed test logger to Nop logger |
| server/server_test.go | Updated test error handling for new NewEmulatorServer signature |
| server/server.go | Changed NewEmulatorServer to return errors; enhanced logging in DetectRemoteChainID |
| server/fork_integration_test.go | Updated tests for new error handling and added buffer to fork height |
| cmd/emulator/start/start.go | Updated error handling for NewEmulatorServer |
| .github/workflows/ci.yml | Removed GRPC_GO_RETRY environment variable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
|
|
||
| const ( | ||
| defaultMaxAttempts = 10 |
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.
Should these be configurable for any reason?
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.
It could be fine tuned, but imo this is a good enough general number for now.
c7e0d81 to
c099e94
Compare
The previous PR #916 unintentionally committed changes via auto-merge. This PR corrects these.
It was discovered that the built-in GRPC retry mechanism does not always work with Flow public access nodes, as it instructs clients not to retry despite eventually having sufficient resources to reschedule requests. For this reason, I have just switched this to a simple client middleware.
For contributor use:
masterbranchFiles changedin the GitHub PR explorer