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): Only rotate log on SIGHUP if needed #12740

Merged
merged 3 commits into from
Mar 1, 2023

Conversation

powersj
Copy link
Contributor

@powersj powersj commented Feb 24, 2023

The current code will rotate a log on a SIGHUP. Whether the log needs to be rotated or not. There are checks at start-up and at each write if a log needs to be rotated. Meaning that we should not be forcing a rotation at close, and instead check to verify the conditions are even met first.

fixes: #12709

The current code will rotate a log on a SIGHUP. Whether the log needs to
be rotate or not. There are checks at start up and at each write if a
log needs to be rotated. Meaning that we should not be forcing a rotate
at close, and instead check to verify the conditions are even met first.

fixes: influxdata#12709
@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Feb 24, 2023
@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 28, 2023
@powersj powersj marked this pull request as ready for review February 28, 2023 18:45
Copy link
Member

@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.

Nice fix @powersj! I would suggest to limit the scope of the error, but I'm fine either way. Leaving the decision to you...

internal/rotate/file_writer.go Outdated Show resolved Hide resolved
@srebhan srebhan assigned powersj and unassigned srebhan Mar 1, 2023
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
@powersj powersj merged commit 3f3885a into influxdata:master Mar 1, 2023
@powersj powersj deleted the fix/12709 branch March 1, 2023 14:30
@tguenneguez
Copy link
Contributor

thanks a lot for change

@srebhan srebhan added this to the v1.26.0 milestone Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Name of log change after signal SIGHUP
3 participants