-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Conversation
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
There was a problem hiding this 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...
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 👍 This pull request doesn't change the Telegraf binary size 📦 Click here to get additional PR build artifactsArtifact URLs |
thanks a lot for change |
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