From 6915ae51f3cc4db8b7cb5b4efdc1e11ae41f8219 Mon Sep 17 00:00:00 2001 From: Rebecca Mahany-Horton Date: Fri, 15 Nov 2024 11:10:31 -0500 Subject: [PATCH 1/2] Add context error to error output to make it clearer when we're timing out --- ee/debug/checkups/osquery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/debug/checkups/osquery.go b/ee/debug/checkups/osquery.go index a00fea65a..c7db0c879 100644 --- a/ee/debug/checkups/osquery.go +++ b/ee/debug/checkups/osquery.go @@ -77,7 +77,7 @@ func (o *osqueryCheckup) interactive(ctx context.Context) error { out, err := cmd.CombinedOutput() o.executionTimes[cmd.String()] = fmt.Sprintf("%d ms", time.Now().UnixMilli()-startTime) if err != nil { - return fmt.Errorf("running %s interactive: err %w, output %s", launcherPath, err, string(out)) + return fmt.Errorf("running %s interactive: err %w, output %s; ctx err: %+v", launcherPath, err, string(out), cmdCtx.Err()) } return nil From a5d4f95ee649a5aa445d356e492afa713477e91a Mon Sep 17 00:00:00 2001 From: Rebecca Mahany-Horton Date: Fri, 15 Nov 2024 11:13:39 -0500 Subject: [PATCH 2/2] Give launcher interactive enough time to exit on Windows --- ee/debug/checkups/checkups.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/debug/checkups/checkups.go b/ee/debug/checkups/checkups.go index 71c3886c0..9979bc93d 100644 --- a/ee/debug/checkups/checkups.go +++ b/ee/debug/checkups/checkups.go @@ -233,7 +233,7 @@ func RunDoctor(ctx context.Context, k types.Knapsack, w io.Writer) { warningCheckups := []string{} for _, c := range checkupsFor(k, doctorSupported) { - ctx, cancel := context.WithTimeout(context.TODO(), 10*time.Second) + ctx, cancel := context.WithTimeout(context.TODO(), 20*time.Second) defer cancel() doctorCheckup(ctx, c, w)