-
Notifications
You must be signed in to change notification settings - Fork 32
Backoffs in Agent: #331
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
Backoffs in Agent: #331
Conversation
This mitigates for thundering herd issues. This is done in the agent and not in the transport so that backoffs in a transport can have their own logic. For example, in the gRPC transport, the server does the backoffs so the client doesn't need to. Signed-off-by: Jacob Weinstock <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #331 +/- ##
==========================================
+ Coverage 51.13% 51.24% +0.10%
==========================================
Files 105 105
Lines 6942 8870 +1928
==========================================
+ Hits 3550 4545 +995
- Misses 3127 4062 +935
+ Partials 265 263 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Jacob Weinstock <[email protected]>
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 implements exponential backoff functionality in the agent to mitigate thundering herd issues when polling for work. The backoff is implemented at the agent level rather than transport level to allow different transports to handle their own retry logic.
- Adds exponential backoff with configurable max interval when no actions are available or errors occur
- Removes specific gRPC connection refused logging in favor of general backoff handling
- Adds command-line configuration for backoff max interval with 5-second default
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tink/agent/agent.go | Implements exponential backoff logic and configuration structure |
| tink/agent/internal/transport/grpc/grpc.go | Removes specific connection refused error logging |
| cmd/agent/main.go | Sets default backoff configuration |
| cmd/agent/flags.go | Adds command-line flag for backoff max interval |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Simpler. If more are needed they can be added in the future. Signed-off-by: Jacob Weinstock <[email protected]>
25210ef to
af3ab15
Compare
Also, git ignore vscode settings. Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
03994ee to
08877d7
Compare
## Description This mitigates for thundering herd issues. This is done in the agent and not in the transport, so that backoffs in a transport can have their logic. For example, in the gRPC transport, the server does the backoffs, so the client doesn't need to. ## Why is this needed Fixes: # ## How Has This Been Tested? ## How are existing users impacted? What migration steps/scripts do we need? ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
## Description This mitigates for thundering herd issues. This is done in the agent and not in the transport, so that backoffs in a transport can have their logic. For example, in the gRPC transport, the server does the backoffs, so the client doesn't need to. ## Why is this needed Fixes: # ## How Has This Been Tested? ## How are existing users impacted? What migration steps/scripts do we need? ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
## Description This mitigates for thundering herd issues. This is done in the agent and not in the transport, so that backoffs in a transport can have their logic. For example, in the gRPC transport, the server does the backoffs, so the client doesn't need to. ## Why is this needed Fixes: # ## How Has This Been Tested? ## How are existing users impacted? What migration steps/scripts do we need? ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
Description
This mitigates for thundering herd issues. This is done in the agent and not in the transport, so that backoffs in a transport can have their logic. For example, in the gRPC transport, the server does the backoffs, so the client doesn't need to.
Why is this needed
Fixes: #
How Has This Been Tested?
How are existing users impacted? What migration steps/scripts do we need?
Checklist:
I have: