19.03: logfile: Check if log is closed on close error during rotate#40921
Merged
thaJeztah merged 2 commits intomoby:19.03from May 7, 2020
Merged
19.03: logfile: Check if log is closed on close error during rotate#40921thaJeztah merged 2 commits intomoby:19.03from
thaJeztah merged 2 commits intomoby:19.03from
Conversation
Member
|
pls re-cherry-pick |
303e20c to
b726305
Compare
full diff: pkg/errors@v0.8.1...v0.9.1 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit dc089c2) Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This prevents getting into a situation where a container log cannot make progress because we tried to rotate a file, got an error, and now the file is closed. The next time we try to write a log entry it will try and rotate again but error that the file is already closed. I wonder if there is more we can do to beef up this rotation logic. Found this issue while investigating missing logs with errors in the docker daemon logs like: ``` Failed to log message for json-file: error closing file: close <file>: file already closed ``` I'm not sure why the original rotation failed since the data was no longer available. Signed-off-by: Brian Goff <cpuguy83@gmail.com> (cherry picked from commit 3989f91) Signed-off-by: Brian Goff <cpuguy83@gmail.com>
b726305 to
7d4dd91
Compare
Member
Author
|
Good to go. |
Member
|
Also includes one commit from #40774 |
Member
|
@tonistiigi @tiborvass PTAL |
tonistiigi
approved these changes
May 7, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This prevents getting into a situation where a container log cannot make
progress because we tried to rotate a file, got an error, and now the
file is closed. The next time we try to write a log entry it will try
and rotate again but error that the file is already closed.
I wonder if there is more we can do to beef up this rotation logic.
Found this issue while investigating missing logs with errors in the
docker daemon logs like:
I'm not sure why the original rotation failed since the data was no
longer available.
Cherry-picks #40920