Skip to content
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

Retry running a CRD Manager if it fails #2202

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ptodev
Copy link
Contributor

@ptodev ptodev commented Dec 2, 2024

PR Description

Setting up a k8s informer may time out (see #2161). In that case, we'd only retry setting up an informer the next time Alloy's config changes. We should retry sooner than that, since the config may never change.

Notes to the Reviewer

A few reasons why the PR is in draft stage:

  • No unit tests have been added yet.
  • I'm not sure what is a good retry value. I suppose it should be something between 30 seconds and 60 seconds.

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

level.Error(c.opts.Logger).Log("msg", "error running crd manager", "err", err)
errChan <- err
//TODO: What is a good default value for this?
retryInterval = 30 * time.Second
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use backoff to avoid thundering herd problems. You can use a similar approach to this: https://github.com/grafana/alloy/blob/main/internal/runtime/internal/controller/loader.go#L732

for {
select {
case <-innerCtx.Done():
//TODO: Log that the manager is exiting?
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say let's add a debug level just in case.

Copy link
Contributor

github-actions bot commented Jan 2, 2025

This PR has not had any activity in the past 30 days, so the needs-attention label has been added to it.
If you do not have enough time to follow up on this PR or you think it's no longer relevant, consider closing it.
The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your PR will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity.
Thank you for your contributions!

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

Successfully merging this pull request may close these issues.

2 participants