From b61b1c9b7cf444985fd6fcaec491497fff0981d8 Mon Sep 17 00:00:00 2001 From: Alex Couture-Beil Date: Fri, 17 Nov 2023 15:45:13 -0800 Subject: [PATCH] dont log context canceled errors A context canceled error will occur once the runc container has exited, there is not need to log these errors. Additionally, remove a printf that was accidentally committed. --- executor/runcexecutor/monitor_stats.go | 3 +++ worker/base/worker.go | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/executor/runcexecutor/monitor_stats.go b/executor/runcexecutor/monitor_stats.go index b2d3cfc49..79b63d872 100644 --- a/executor/runcexecutor/monitor_stats.go +++ b/executor/runcexecutor/monitor_stats.go @@ -52,6 +52,9 @@ func (w *runcExecutor) monitorContainerStats(ctx context.Context, id string, sam stats, err := w.runc.Stats(ctx, id) if err != nil { + if errors.Is(err, context.Canceled) { + return + } if numFailuresAllowed > 0 { // allow the initial calls to runc.Stats to fail, for cases where the program didn't start within the initial // sampleFrequency; this should only occur under heavy workloads diff --git a/worker/base/worker.go b/worker/base/worker.go index 0f88e29c9..e98f76214 100644 --- a/worker/base/worker.go +++ b/worker/base/worker.go @@ -334,7 +334,6 @@ func (w *Worker) ResolveOp(v solver.Vertex, s frontend.FrontendLLBBridge, sm *se case *pb.Op_Source: return ops.NewSourceOp(v, op, baseOp.Platform, w.SourceManager, w.ParallelismSem, sm, w) case *pb.Op_Exec: - fmt.Printf("Worker.ResolveOp called\n") // this just gets called once even with two client return ops.NewExecOp(v, op, baseOp.Platform, w.CacheMgr, w.ParallelismSem, sm, w.WorkerOpt.Executor, w) case *pb.Op_File: return ops.NewFileOp(v, op, w.CacheMgr, w.ParallelismSem, w)