Skip to content

ctr: drain exec output before cleanup - #13931

Merged
mxpv merged 1 commit into
containerd:mainfrom
cayoub-oai:codex/upstream-ctr-exec-output-drain
Aug 11, 2026
Merged

mxpv merged 1 commit into
containerd:mainfrom
cayoub-oai:codex/upstream-ctr-exec-output-drain

Conversation

@cayoub-oai

@cayoub-oai cayoub-oai commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Wait for stdout and stderr copying to complete after validating process exit so deferred process deletion does not cancel readers with output still in flight.

Similar to: containerd/nerdctl#4392

Drain container stdout and stderr before process deletion in ctr exec

Wait for stdout and stderr copying to complete after validating process exit so deferred process deletion does not cancel readers with output still in flight.

Signed-off-by: Chris Ayoub <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates ctr tasks exec to ensure stdout/stderr copy operations are fully drained after the exec process exits, preventing deferred process cleanup from canceling IO readers while output is still in flight.

Changes:

  • After retrieving the exec process exit status, wait for IO copy goroutines to complete.
  • Close the process IO after draining, before returning (and before deferred process.Delete runs).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Aug 11, 2026
@mxpv
mxpv added this pull request to the merge queue Aug 11, 2026
Merged via the queue into containerd:main with commit 7ef00a5 Aug 11, 2026
51 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Aug 11, 2026
@samuelkarp samuelkarp added impact/changelog area/ctr ctr development tool and removed impact/changelog labels Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ctr ctr development tool size/XS

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants