mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #28854 from coolljt0725/igore_close_stderr_error
Ignore "failed to close stdin" if container or process not found
This commit is contained in:
commit
f9ddac3f3c
2 changed files with 5 additions and 1 deletions
|
@ -135,7 +135,7 @@ func (c *Config) CopyToPipe(iop libcontainerd.IOPipe) {
|
||||||
go func() {
|
go func() {
|
||||||
pools.Copy(iop.Stdin, stdin)
|
pools.Copy(iop.Stdin, stdin)
|
||||||
if err := iop.Stdin.Close(); err != nil {
|
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"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
goruntime "runtime"
|
goruntime "runtime"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
containerd "github.com/docker/containerd/api/grpc/types"
|
containerd "github.com/docker/containerd/api/grpc/types"
|
||||||
|
@ -86,6 +87,9 @@ func (p *process) sendCloseStdin() error {
|
||||||
Pid: p.friendlyName,
|
Pid: p.friendlyName,
|
||||||
CloseStdin: true,
|
CloseStdin: true,
|
||||||
})
|
})
|
||||||
|
if err != nil && (strings.Contains(err.Error(), "container not found") || strings.Contains(err.Error(), "process not found")) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue