Skip to content

Commit

Permalink
fix: cio.Cancel() should close the pipes
Browse files Browse the repository at this point in the history
PR fixes #8326.

Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
(cherry picked from commit 82ec62b)
Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
  • Loading branch information
davidhsingyuchen committed Jun 1, 2023
1 parent deec965 commit 99582fb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cio/io_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,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
}

Expand Down

0 comments on commit 99582fb

Please sign in to comment.