diff --git a/runtime/v2/binary.go b/runtime/v2/binary.go index 49ecd80e9..51845bfee 100644 --- a/runtime/v2/binary.go +++ b/runtime/v2/binary.go @@ -98,6 +98,9 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_ go func() { defer f.Close() _, err := io.Copy(os.Stderr, f) + // To prevent flood of error messages, the expected error + // should be reset, like os.ErrClosed or os.ErrNotExist, which + // depends on platform. err = checkCopyShimLogError(ctx, err) if err != nil { log.G(ctx).WithError(err).Error("copy shim log") diff --git a/runtime/v2/shim.go b/runtime/v2/shim.go index a8c614634..893926c18 100644 --- a/runtime/v2/shim.go +++ b/runtime/v2/shim.go @@ -97,6 +97,9 @@ func loadShim(ctx context.Context, bundle *Bundle, events *exchange.Exchange, rt go func() { defer f.Close() _, err := io.Copy(os.Stderr, f) + // To prevent flood of error messages, the expected error + // should be reset, like os.ErrClosed or os.ErrNotExist, which + // depends on platform. err = checkCopyShimLogError(ctx, err) if err != nil { log.G(ctx).WithError(err).Error("copy shim log after reload")