Skip to content

Conversation

@dmcgowan
Copy link
Member

Fixes an issue that shows up when exiting a container with terminal attached. Currently docker run will hang on shutdown with the -t option. This was caused because the console was getting wrapped and causing the console not to shutdown, keeping stdout open.

Signed-off-by: Derek McGowan <[email protected]>
Copilot AI review requested due to automatic review settings November 21, 2025 08:45
Copy link

Copilot AI left a comment

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 fixes a shutdown hang issue that occurs when exiting a container with a terminal attached (using the -t option in docker run). The hang was caused by the console being wrapped in a way that prevented proper shutdown, keeping stdout open indefinitely.

Key changes:

  • Changed closingConsole to embed *console.EpollConsole directly instead of the console.Console interface, enabling direct access to the Shutdown method
  • Updated ShutdownConsole to use duck typing via an anonymous interface, making it compatible with both *console.EpollConsole and *closingConsole
  • Updated field initialization in CopyConsole to match the new struct field name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dmcgowan dmcgowan merged commit bde7066 into containerd:main Nov 21, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants