Merge pull request #5222 from fuweid/follow-up-5174

runtime/v2: add comment for checkCopyShimLogError
This commit is contained in:
Phil Estes 2021-03-18 09:18:43 -04:00 committed by GitHub
commit 92c1bbb253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -98,6 +98,9 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_
go func() { go func() {
defer f.Close() defer f.Close()
_, err := io.Copy(os.Stderr, f) _, 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) err = checkCopyShimLogError(ctx, err)
if err != nil { if err != nil {
log.G(ctx).WithError(err).Error("copy shim log") log.G(ctx).WithError(err).Error("copy shim log")

View File

@ -97,6 +97,9 @@ func loadShim(ctx context.Context, bundle *Bundle, events *exchange.Exchange, rt
go func() { go func() {
defer f.Close() defer f.Close()
_, err := io.Copy(os.Stderr, f) _, 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) err = checkCopyShimLogError(ctx, err)
if err != nil { if err != nil {
log.G(ctx).WithError(err).Error("copy shim log after reload") log.G(ctx).WithError(err).Error("copy shim log after reload")