8000 container/run: Fix stdout/err truncation after container exit by vvoland · Pull Request #5957 · docker/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

container/run: Fix stdout/err truncation after container exit #5957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 24, 2025

Conversation

vvoland
Copy link
Collaborator
@vvoland vvoland commented Mar 24, 2025

Fix a regression introduced by 30c4637
which made the docker run command produce potentially truncated
stdout/stderr output.

Previous implementation stopped the content streaming as soon as the
container exited which would potentially truncate a long outputs.

This change fixes the issue by only canceling the IO stream immediately
if neither stdout nor stderr is attached.

Fix `docker run` truncating the `STDOUT`/`STDERR` prematurely when the container exits before the data is consumed.

@vvoland vvoland added this to the 28.0.3 milestone Mar 24, 2025
@vvoland vvoland self-assigned this Mar 24, 2025
@codecov-commenter
Copy link
codecov-commenter commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 59.46%. Comparing base (ff5fdfa) to head (5a8120c).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5957      +/-   ##
==========================================
- Coverage   59.47%   59.46%   -0.01%     
==========================================
  Files         357      357              
  Lines       29744    29750       +6     
==========================================
+ Hits        17690    17691       +1     
- Misses      11090    11091       +1     
- Partials      964      968       +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vvoland vvoland requested a review from laurazard March 24, 2025 15:41
@vvoland vvoland marked this pull request as ready for review March 24, 2025 15:41
Copy link
Collaborator
@laurazard laurazard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

vvoland added 2 commits March 24, 2025 17:09
Fix a regression introduced by 30c4637
which made the `docker run` command produce potentially truncated
stdout/stderr output.

Previous implementation stopped the content streaming as soon as the
container exited which would potentially truncate a long outputs.

This change fixes the issue by only canceling the IO stream immediately
if neither stdout nor stderr is attached.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Restore part of the code removed by 966b441
that closed the stream. It's required now because the Run command won't
finish before the output stream was processed by the caller.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland merged commit cfaaeb0 into docker:master Mar 24, 2025
87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker Desktop truncates the standard output docker run truncates stdout when output is large
4 participants
0