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

Fix goroutine leak in local.file #6347

Closed
wants to merge 1 commit into from
Closed

Conversation

wildum
Copy link
Contributor

@wildum wildum commented Feb 9, 2024

PR Description

Call UpdateArgs instead of Update in the New() function to avoid starting goroutines before Run() is called

Which issue(s) this PR fixes

Fixes grafana/alloy#247

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated

Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

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

Thanks for taking a crack at this! I find this a little hard to reason about, as now I have to track down to make sure no fields set in Update are needed at construction time, and that they're all set once Run is fully in motion.

Instead of creating two updates, can we try to prevent the goroutine from being started until Run is called?

err := c.UpdateArgs(args)
if err != nil {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think Run() could be called without calling Update(). In that case, is the fact that we didn't call c.configureDetector() prior to Run() a problem?

Copy link
Contributor

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!

@github-actions github-actions bot added the needs-attention An issue or PR has been sitting around and needs attention. label Mar 14, 2024
@rfratto rfratto added variant/flow Relatd to Grafana Agent Flow. bug Something isn't working labels Apr 9, 2024
@github-actions github-actions bot removed the needs-attention An issue or PR has been sitting around and needs attention. label Apr 11, 2024
@wildum wildum closed this May 10, 2024
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Jun 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. variant/flow Relatd to Grafana Agent Flow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Goroutine leak if initial eval process fail for some components
3 participants