Skip to content

Commit 82f2ac7

Browse files
authored
Merge pull request #3252 from jterry75/remove_log_connect_error
Stop logging error on v2 multi shim log failure
2 parents c10eb8d + 969035b commit 82f2ac7

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

runtime/v2/binary.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ func (b *binary) Start(ctx context.Context) (_ *shim, err error) {
8484
go func() {
8585
defer f.Close()
8686
if _, err := io.Copy(os.Stderr, f); err != nil {
87-
log.G(ctx).WithError(err).Error("copy shim log")
87+
// When using a multi-container shim the 2nd to Nth container in the
88+
// shim will not have a seperate log pipe. Ignore the failure log
89+
// message here when the shim connect times out.
90+
if !os.IsNotExist(errors.Cause(err)) {
91+
log.G(ctx).WithError(err).Error("copy shim log")
92+
}
8893
}
8994
}()
9095
out, err := cmd.CombinedOutput()

runtime/v2/shim.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ func loadShim(ctx context.Context, bundle *Bundle, events *exchange.Exchange, rt
7070
go func() {
7171
defer f.Close()
7272
if _, err := io.Copy(os.Stderr, f); err != nil {
73-
log.G(ctx).WithError(err).Error("copy shim log")
73+
// When using a multi-container shim the 2nd to Nth container in the
74+
// shim will not have a seperate log pipe. Ignore the failure log
75+
// message here when the shim connect times out.
76+
if !os.IsNotExist(errors.Cause(err)) {
77+
log.G(ctx).WithError(err).Error("copy shim log")
78+
}
7479
}
7580
}()
7681

0 commit comments

Comments
 (0)