From 828f6eb842451a3bb9577b731e2e09bbd59d0e42 Mon Sep 17 00:00:00 2001 From: "Justin Terry (VM)" Date: Wed, 27 Feb 2019 16:51:52 -0800 Subject: [PATCH] Fix a bug in shim log on Windows that can cause 100% CPU utilization With the change to unified shims (ie: 1 shim per multiple tasks) the shimLog on Windows for the 2nd-Nth worload containers will not have an associated named pipe listener. Due to a subtle bug in errors.Wrap passing a nil error we would unblock the disconnected listener and return 0 byte successfull reads which would cause go to continually read and cap the CPU. Signed-off-by: Justin Terry (VM) --- runtime/v2/shim_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/v2/shim_windows.go b/runtime/v2/shim_windows.go index fbf3459d1..60a89f1a7 100644 --- a/runtime/v2/shim_windows.go +++ b/runtime/v2/shim_windows.go @@ -78,7 +78,7 @@ func openShimLog(ctx context.Context, bundle *Bundle) (io.ReadCloser, error) { time.Second*10, ) if conerr != nil { - dpc.conerr = errors.Wrap(err, "failed to connect to shim log") + dpc.conerr = errors.Wrap(conerr, "failed to connect to shim log") } dpc.c = c dpc.wg.Done()