-
Notifications
You must be signed in to change notification settings - Fork 188
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
Support fine-grained logrotateAdditionalFiles intervals, with a separate logrotate conf file for each configured interval #2180
Conversation
…tate, use the schedule with the highest frequency.
…ditionalFiles interval.
NOTE: This PR changes the filename format for the conf files written to |
{{#if logrotateSizeBasedConfig}} | ||
{{{ cronSchedule }}} root {{{ logrotateCommand }}} -s {{{ logrotateStateFile }}} {{{ logrotateSizeBasedConfig }}} {{{ outputRedirect }}} | ||
*/5 * * * * root {{{ logrotateCommand }}} -s {{{ logrotateStateFile }}} {{{ logrotateSizeBasedConfig }}} {{{ outputRedirect }}} |
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.
This isn't strictly related to this PR, but I noticed that we were previously only evaluating size-based logrotateAdditionalFiles
configs every hour. This hardcodes it to every five minutes, which makes it less likely that we let an extremely high-volume logfile fill up a Mesos host. Happy to lengthen this interval (or back out this change entirely) if we think this is too frequent, though.
@baconmania is this one still needed? |
Yeah - we're still working on testing it |
In Singularity, we don't want to rely on
logrotate(8)
on Mesos agent hosts having support forhourly
or finer-grained logrotate intervals. We therefore "fake" it by having SingularityExecutor write cron entries with schedules corresponding to those finer-grained intervals. These cron entries invokelogrotate -f
to force rotation on the cron schedule.Up until now, the only one of these "finer" intervals we supported in Singularity was
hourly
. We'd now like to support even finer intervals than that. However, Singularity up until now has written all these "cron-faked" hourly logrotate entries for a given Singularity Task to a single logrotate conf file. If we now add support for "cron-faked" rotation every five minutes, for example, we wouldn't want to write them into the same logrotate file as an hourly config, because then when cron callslogrotate -f
on the file, it'll run both the hourly and the five-minutely configs.This PR addresses this problem by separating out the cron-faked logrotate conf files by interval. So now, if we have three
logrotateAdditionalFiles
in SingularityExecutor's configuration......then we write three separate logrotate conf files:
...and the cron file now looks like: