Skip to content

Commit

Permalink
runtime: log IO error when copying output streams
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Wagner <thepwagner@github.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thepwagner authored and thaJeztah committed Apr 1, 2019
1 parent 2bf4d3a commit 255da2a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions linux/proc/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"sync"
"syscall"

"github.com/containerd/containerd/log"
"github.com/containerd/fifo"
runc "github.com/containerd/go-runc"
)
Expand All @@ -52,7 +53,9 @@ func copyPipes(ctx context.Context, rio runc.IO, stdin, stdout, stderr string, w
cwg.Done()
p := bufPool.Get().(*[]byte)
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()
wc.Close()
if rc != nil {
Expand All @@ -69,7 +72,9 @@ func copyPipes(ctx context.Context, rio runc.IO, stdin, stdout, stderr string, w
cwg.Done()
p := bufPool.Get().(*[]byte)
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()
wc.Close()
if rc != nil {
Expand Down

0 comments on commit 255da2a

Please sign in to comment.