containerd/patch/0102-contained-fix-cio.Cancel-should-close-the-pipes.patch
2023-09-22 13:58:07 +08:00

36 lines
852 B
Diff

From 1b94345a4ce03a4ea54717df3b5a9a12a99a53cc Mon Sep 17 00:00:00 2001
From: "Hsing-Yu (David) Chen" <davidhsingyuchen@gmail.com>
Date: Thu, 30 Mar 2023 18:38:54 -0700
Subject: [PATCH] fix: cio.Cancel() should close the pipes
PR fixes #8326.
Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
---
cio/io_unix.go | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/cio/io_unix.go b/cio/io_unix.go
index 53b6b2dee..644e840e6 100644
--- a/cio/io_unix.go
+++ b/cio/io_unix.go
@@ -99,7 +99,14 @@ func copyIO(fifos *FIFOSet, ioset *Streams) (*cio, error) {
config: fifos.Config,
wg: wg,
closers: append(pipes.closers(), fifos),
- cancel: cancel,
+ cancel: func() {
+ cancel()
+ for _, c := range pipes.closers() {
+ if c != nil {
+ c.Close()
+ }
+ }
+ },
}, nil
}
--
2.33.0