Merge pull request #3252 from jterry75/remove_log_connect_error

Stop logging error on v2 multi shim log failure
This commit is contained in:
Derek McGowan 2019-05-03 17:03:49 -07:00 committed by GitHub
commit 82f2ac7ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -84,8 +84,13 @@ func (b *binary) Start(ctx context.Context) (_ *shim, err error) {
go func() {
defer f.Close()
if _, err := io.Copy(os.Stderr, f); err != nil {
// 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()
if err != nil {

View File

@ -70,8 +70,13 @@ 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 {
// 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")
}
}
}()
client := ttrpc.NewClient(conn, ttrpc.WithOnClose(func() { _ = conn.Close() }))