runtime: log IO error when copying output streams
Signed-off-by: Peter Wagner <thepwagner@github.com>
This commit is contained in:
parent
2d0a06d41b
commit
e96ac2040d
@ -29,6 +29,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/containerd/containerd/log"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
"github.com/containerd/containerd/runtime/proc"
|
"github.com/containerd/containerd/runtime/proc"
|
||||||
"github.com/containerd/fifo"
|
"github.com/containerd/fifo"
|
||||||
@ -136,7 +137,9 @@ func copyPipes(ctx context.Context, rio runc.IO, stdin, stdout, stderr string, w
|
|||||||
cwg.Done()
|
cwg.Done()
|
||||||
p := bufPool.Get().(*[]byte)
|
p := bufPool.Get().(*[]byte)
|
||||||
defer bufPool.Put(p)
|
defer bufPool.Put(p)
|
||||||
io.CopyBuffer(wc, rio.Stdout(), *p)
|
if _, err := io.CopyBuffer(wc, rio.Stdout(), *p); err != nil {
|
||||||
|
log.G(ctx).Warn("error copying stdout")
|
||||||
|
}
|
||||||
wg.Done()
|
wg.Done()
|
||||||
wc.Close()
|
wc.Close()
|
||||||
if rc != nil {
|
if rc != nil {
|
||||||
@ -153,7 +156,9 @@ func copyPipes(ctx context.Context, rio runc.IO, stdin, stdout, stderr string, w
|
|||||||
cwg.Done()
|
cwg.Done()
|
||||||
p := bufPool.Get().(*[]byte)
|
p := bufPool.Get().(*[]byte)
|
||||||
defer bufPool.Put(p)
|
defer bufPool.Put(p)
|
||||||
io.CopyBuffer(wc, rio.Stderr(), *p)
|
if _, err := io.CopyBuffer(wc, rio.Stderr(), *p); err != nil {
|
||||||
|
log.G(ctx).Warn("error copying stderr")
|
||||||
|
}
|
||||||
wg.Done()
|
wg.Done()
|
||||||
wc.Close()
|
wc.Close()
|
||||||
if rc != nil {
|
if rc != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user