Merge pull request #30088 from tonistiigi/fifo-close-early

Close stdout/stderr fifo as soon as possible
Upstream-commit: f018c0dfff3c3dc213b3d3c05228dfed4ef0fb4a
Component: engine
This commit is contained in:
Kenfe-Mickaël Laventure
2017-01-12 09:29:39 -08:00
committed by GitHub

View File

@ -113,12 +113,13 @@ func (c *Config) CloseStreams() error {
// CopyToPipe connects streamconfig with a libcontainerd.IOPipe
func (c *Config) CopyToPipe(iop libcontainerd.IOPipe) {
copyFunc := func(w io.Writer, r io.Reader) {
copyFunc := func(w io.Writer, r io.ReadCloser) {
c.Add(1)
go func() {
if _, err := pools.Copy(w, r); err != nil {
logrus.Errorf("stream copy error: %+v", err)
}
r.Close()
c.Done()
}()
}