Skip to content

Commit

Permalink
containers/attach: Note bug around goroutine leak
Browse files Browse the repository at this point in the history
See:

- containers/podman-bootc#59 (comment)
- containers/podman-bootc#61

Sorry for not trying to fix this, but I am not aware of
a remotely straightforward way to do so.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Jul 9, 2024
1 parent 4b29c9d commit 87cb8e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/bindings/containers/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ type CloseWriter interface {
CloseWrite() error
}

// Attach attaches to a running container
// Attach attaches to a running container.
//
// NOTE: When the container is configured to use a tty and stdin is a tty,
// this currently leaks a goroutine reading from stdin even if the ctx is cancelled.
func Attach(ctx context.Context, nameOrID string, stdin io.Reader, stdout io.Writer, stderr io.Writer, attachReady chan bool, options *AttachOptions) error {
if options == nil {
options = new(AttachOptions)
Expand Down

0 comments on commit 87cb8e9

Please sign in to comment.