Skip to content

Make agent reconnect retry timeout configurable#6470

Merged
6543 merged 8 commits into
woodpecker-ci:mainfrom
6543-forks:6414-config
Apr 23, 2026
Merged

Make agent reconnect retry timeout configurable#6470
6543 merged 8 commits into
woodpecker-ci:mainfrom
6543-forks:6414-config

Conversation

@6543
Copy link
Copy Markdown
Member

@6543 6543 commented Apr 19, 2026

@6543 6543 requested a review from lafriks April 19, 2026 21:51
@woodpecker-bot
Copy link
Copy Markdown
Contributor

woodpecker-bot commented Apr 19, 2026

Surge PR preview deployment was removed

@6543 6543 mentioned this pull request Apr 19, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.28%. Comparing base (8e6084c) to head (c71f750).

Files with missing lines Patch % Lines
agent/rpc/client_grpc.go 25.00% 11 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6470      +/-   ##
==========================================
+ Coverage   41.25%   41.28%   +0.03%     
==========================================
  Files         431      431              
  Lines       28792    28805      +13     
==========================================
+ Hits        11878    11893      +15     
+ Misses      15847    15845       -2     
  Partials     1067     1067              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@6543 6543 mentioned this pull request Apr 19, 2026
16 tasks
@6543 6543 requested a review from a team April 21, 2026 00:03
@qwerty287
Copy link
Copy Markdown
Contributor

Just wondering, we don't use the backoff library there right?

@6543
Copy link
Copy Markdown
Member Author

6543 commented Apr 23, 2026

we do use backoff lib:

time.Sleep(retry.NextBackOff())

retry := c.newBackOff()

func (c *client) newBackOff() backoff.BackOff {

@qwerty287
Copy link
Copy Markdown
Contributor

@6543
Copy link
Copy Markdown
Member Author

6543 commented Apr 23, 2026

I can look into that but that would be a refactoring followup pull :)

Copy link
Copy Markdown
Contributor

@qwerty287 qwerty287 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ok for me, but remind that you then likely have to change the env var behavior which is breaking as the backoff lib doesn't support cumulated timeout. It can only limit the number of retries (which is what we usually do, so I'd go with that) or the duration between two tries.

PR is not tested at my side

@6543
Copy link
Copy Markdown
Member Author

6543 commented Apr 23, 2026

The lib should support max timeout period ... but even if not, we just have it in our code. Limiting to featureset of an external dependency is not something we should do if easy to make it ourselfe work.

anyway, I'll look into using the backoff lib more directly

@6543 6543 merged commit ea07160 into woodpecker-ci:main Apr 23, 2026
6 of 7 checks passed
@6543 6543 deleted the 6414-config branch April 23, 2026 15:35
@woodpecker-bot woodpecker-bot mentioned this pull request Apr 23, 2026
1 task
@qwerty287
Copy link
Copy Markdown
Contributor

You're right, the correct function you should use is https://pkg.go.dev/github.com/cenkalti/backoff/v5#WithMaxElapsedTime I guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent enhancement improve existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants