Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jacobweinstock
Copy link
Member

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

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]>
@jacobweinstock jacobweinstock added the do-not-merge Signal Mergify to block merging of the PR label Aug 17, 2025
@codecov
Copy link

codecov bot commented Aug 17, 2025

Codecov Report

❌ Patch coverage is 40.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.24%. Comparing base (a6e8bf0) to head (08877d7).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
tink/agent/agent.go 40.00% 18 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jacobweinstock jacobweinstock requested a review from Copilot August 18, 2025 14:55
@jacobweinstock jacobweinstock removed the do-not-merge Signal Mergify to block merging of the PR label Aug 18, 2025
Copy link
Contributor

Copilot AI left a 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]>
Also, git ignore vscode settings.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock added the ready-to-merge Signal Mergify to merge the PR label Aug 18, 2025
@mergify mergify bot merged commit 6cfd47a into tinkerbell:main Aug 18, 2025
13 checks passed
@jacobweinstock jacobweinstock deleted the agent-thundering-herd branch August 18, 2025 17:22
elauriault pushed a commit to elauriault/tinkerbell that referenced this pull request Oct 17, 2025
## 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
elauriault pushed a commit to elauriault/tinkerbell that referenced this pull request Oct 18, 2025
## 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
elauriault pushed a commit to elauriault/tinkerbell that referenced this pull request Oct 18, 2025
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Signal Mergify to merge the PR tink-agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant