Merge pull request #28854 from coolljt0725/igore_close_stderr_error

Ignore "failed to close stdin" if container or process not found
Upstream-commit: f9ddac3f3cb1edece22f4515671cf9b461975a12
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2016-11-30 10:23:27 +01:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
@@ -135,7 +135,7 @@ func (c *Config) CopyToPipe(iop libcontainerd.IOPipe) {
go func() {
pools.Copy(iop.Stdin, stdin)
if err := iop.Stdin.Close(); err != nil {
logrus.Errorf("failed to close stdin: %+v", err)
logrus.Warnf("failed to close stdin: %+v", err)
}
}()
}
@@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
goruntime "runtime"
"strings"
"time"
containerd "github.com/docker/containerd/api/grpc/types"
@@ -86,6 +87,9 @@ func (p *process) sendCloseStdin() error {
Pid: p.friendlyName,
CloseStdin: true,
})
if err != nil && (strings.Contains(err.Error(), "container not found") || strings.Contains(err.Error(), "process not found")) {
return nil
}
return err
}