This repository has been archived by the owner on Oct 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[17.06] Fix log readers can block writes indefinitely #98
Merged
Conversation
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
Before this patch, a log reader is able to block all log writes indefinitely (and other operations) by simply opening the log stream and not consuming all the messages. The reason for this is we protect the read stream from corruption by ensuring there are no new writes while the log stream is consumed (and caught up with the live entries). We can get around this issue because log files are append only, so we can limit reads to only the section of the file that was written to when the log stream was first requested. Now logs are only blocked until all files are opened, rather than streamed to the client. Signed-off-by: Brian Goff <cpuguy83@gmail.com> (cherry picked from commit e220918) Conflicts: components/engine/daemon/logger/jsonfilelog/read.go Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
|
cpuguy83
reviewed
Jul 6, 2017
logWatcher.Err <- err | ||
return | ||
} | ||
|
||
if config.Tail != 0 { | ||
tailer := ioutils.MultiReadSeeker(append(files, latestFile)...) |
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.
Need to replace latestFile
here with latestChunk
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.
done with an additional commit
… working Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
cpuguy83
approved these changes
Jul 12, 2017
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.
LGTM
docker-jenkins
pushed a commit
that referenced
this pull request
Apr 4, 2018
Add packaging code for Fedora 28 Upstream-commit: 9efc79d Component: packaging
silvin-lubecki
pushed a commit
to silvin-lubecki/docker-ce
that referenced
this pull request
Jan 30, 2020
Add packaging code for Fedora 28 Upstream-commit: 9efc79d Component: packaging
silvin-lubecki
pushed a commit
to silvin-lubecki/docker-ce
that referenced
this pull request
Jan 30, 2020
Add packaging code for Fedora 28
silvin-lubecki
pushed a commit
to silvin-lubecki/docker-ce
that referenced
this pull request
Feb 3, 2020
[17.06] Fix log readers can block writes indefinitely
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backport fix:
The only conflict was in the
components/engine/daemon/logger/jsonfilelog/read.go
file:@cpuguy83 Because moby/moby@2445e6b moved multireader. I decided to go with the
ioutils
line to resolve the conflict. Let me know if I should go the other way and and also cherry-pick the multireader move commit.