-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logging: Respect log-size-max immediately after open
When a container keeps restarting, conmon restarts and opens the log file with O_APPEND every single time, resetting bytes_written to 0 with a non-empty file. If the container fails before writting log-size-max bytes then the log keeps growing indefinitely, potentially using up all the available space. This should be kept in check: initialize bytes_written to the file's current size, so that it can be reset if required (it's possible that the file gets re-open before the first write if it was already above the limit, but that should almost never happen in practice) In order to make this simpler make bytes written global variables
- Loading branch information
Showing
1 changed file
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters