From 969035bcbd002d0985110942af6e834defe7737c Mon Sep 17 00:00:00 2001 From: "Justin Terry (VM)" Date: Tue, 30 Apr 2019 11:20:58 -0700 Subject: [PATCH] Stop logging error on v2 multi shim log failure Signed-off-by: Justin Terry (VM) --- runtime/v2/binary.go | 7 ++++++- runtime/v2/shim.go | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/runtime/v2/binary.go b/runtime/v2/binary.go index eedecba28..326c44f09 100644 --- a/runtime/v2/binary.go +++ b/runtime/v2/binary.go @@ -84,7 +84,12 @@ func (b *binary) Start(ctx context.Context) (_ *shim, err error) { go func() { defer f.Close() if _, err := io.Copy(os.Stderr, f); err != nil { - log.G(ctx).WithError(err).Error("copy shim log") + // When using a multi-container shim the 2nd to Nth container in the + // shim will not have a seperate log pipe. Ignore the failure log + // message here when the shim connect times out. + if !os.IsNotExist(errors.Cause(err)) { + log.G(ctx).WithError(err).Error("copy shim log") + } } }() out, err := cmd.CombinedOutput() diff --git a/runtime/v2/shim.go b/runtime/v2/shim.go index 703168697..afb0a854b 100644 --- a/runtime/v2/shim.go +++ b/runtime/v2/shim.go @@ -70,7 +70,12 @@ func loadShim(ctx context.Context, bundle *Bundle, events *exchange.Exchange, rt go func() { defer f.Close() if _, err := io.Copy(os.Stderr, f); err != nil { - log.G(ctx).WithError(err).Error("copy shim log") + // When using a multi-container shim the 2nd to Nth container in the + // shim will not have a seperate log pipe. Ignore the failure log + // message here when the shim connect times out. + if !os.IsNotExist(errors.Cause(err)) { + log.G(ctx).WithError(err).Error("copy shim log") + } } }()