fix: Ensure logs are not interrupted when disk is full#4603
Open
ningmingxiao wants to merge 1 commit intocontainerd:mainfrom
Open
fix: Ensure logs are not interrupted when disk is full#4603ningmingxiao wants to merge 1 commit intocontainerd:mainfrom
ningmingxiao wants to merge 1 commit intocontainerd:mainfrom
Conversation
AkihiroSuda
reviewed
Nov 17, 2025
| func (pw *discardWriter) Write(p []byte) (int, error) { | ||
| n, err := pw.writer.Write(p) | ||
| if err != nil && errors.As(err, new(syscall.Errno)) { | ||
| return len(p), nil |
Member
There was a problem hiding this comment.
What are you trying to do in this PR?
Doesn't seem correct to discard all syscall errors
AkihiroSuda
requested changes
Nov 17, 2025
…nd later recovers. Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
b496b85 to
89876b5
Compare
AkihiroSuda
reviewed
Nov 17, 2025
|
|
||
| func (pw *discardWriter) Write(p []byte) (int, error) { | ||
| n, err := pw.writer.Write(p) | ||
| if err != nil && errors.Is(err, syscall.ENOSPC) { |
Member
There was a problem hiding this comment.
In the case of ENOSPC, the write should be retried with sleep?
Contributor
Author
There was a problem hiding this comment.
I afraid that if long term retry failed the container main process may hang, because pipe is full.
Contributor
Author
There was a problem hiding this comment.
how long do you think is appropriate? @AkihiroSuda
Contributor
Author
There was a problem hiding this comment.
If retry with some sleep I afraid that the consumer's consumption of container logs is slower than the producer's production of logs.
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.
fix /var/lib/nerdctl dir is full and container's log can't continue even space is freed up. @AkihiroSuda
containerd loguri=file containerd/containerd#12488 also have this problem