Truncate container log files to remove logging delay on restarted container#26
Merged
ArnavReddy merged 2 commits intomainfrom Jun 6, 2025
Merged
Truncate container log files to remove logging delay on restarted container#26ArnavReddy merged 2 commits intomainfrom
ArnavReddy merged 2 commits intomainfrom
Conversation
dcantah
approved these changes
Jun 6, 2025
owenarthur
pushed a commit
to owenarthur/container
that referenced
this pull request
Jun 10, 2025
…tainer (apple#26) When a container that was writing stdout/stderr to its dedicated container log file was stopped and started, there was a ~20 second - 1 minute delay from when the init process was restarted and when the output of the process was written to the log file. This also meant there was a delay when streaming those logs using `container logs -f`. The logs from that delay period were lost. This change forces the container log file to update state after a container restart which fixes the delays to the container log file. And the` container logs -f` stream resets its position in the file on a container restart as well. --------- Co-authored-by: Arnav Reddy <areddy23@apple.com>
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.
When a container that was writing stdout/stderr to its dedicated container log file was stopped and started, there was a ~20 second - 1 minute delay from when the init process was restarted and when the output of the process was written to the log file. This also meant there was a delay when streaming those logs using
container logs -f. The logs from that delay period were lost.This change forces the container log file to update state after a container restart which fixes the delays to the container log file. And the
container logs -fstream resets its position in the file on a container restart as well.