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(agent): reload config on config update #12721

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

powersj
Copy link
Contributor

@powersj powersj commented Feb 22, 2023

In a recent change we moved to loading the config only once during the initial load of telegraf. This saves time and is more efficient from reading files on disk, however, it ignored the fact that we need to reload the config if someone is watching a config. This reload occurs in runAgent, where the second reading was always taking place.

This updates the logic, so that we only re-read the configs in runAgent if we are calling it a second time from the reload loop.

fixes: #12718

In a recent change we moved to loading the config only once during the
initial load of telegraf. This saves time and is more efficient from
reading files on disk, however, it ignored the fact that we need to
reload the config if someone is watching a config. This reload occurs in
runAgent, where the second reading was always taking place.

This updates the logic, so that we only re-read the configs in runAgent
if we are calling it a second time from the reload loop.

fixes: influxdata#12718
@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Feb 22, 2023
@telegraf-tiger
Copy link
Contributor

@powersj powersj requested a review from srebhan February 22, 2023 17:46
@powersj powersj added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Feb 22, 2023
@powersj powersj assigned powersj and srebhan and unassigned powersj Feb 22, 2023
Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Makes sense to me. Thanks for the quick fix @powersj!

@srebhan srebhan merged commit 95877a5 into influxdata:master Feb 22, 2023
powersj added a commit that referenced this pull request Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent fix pr to fix corresponding bug ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

watch config change seems failed
2 participants