From 20eae82f115f0148ae054d199dbb248e7f68c8ec Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Wed, 24 May 2023 18:53:10 +0700 Subject: [PATCH] cmd/ctrld: ensure error passed to backoff is wrapped in self-check In commit 670879d1, the backoff is changed to be passed a real error, instead of a place holder. However, the test query may return a failed response with a nil error, causing the backoff never fire. Fixing this by ensuring the error is wrapped, so the backoff always see a non-nil error. --- cmd/ctrld/cli.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ctrld/cli.go b/cmd/ctrld/cli.go index 811ac56..b9d3f3e 100644 --- a/cmd/ctrld/cli.go +++ b/cmd/ctrld/cli.go @@ -890,7 +890,7 @@ func selfCheckStatus(status service.Status) service.Status { mainLog.Debug().Msgf("self-check against %q succeeded", selfCheckFQDN) return status } - bo.BackOff(ctx, err) + bo.BackOff(ctx, fmt.Errorf("ExchangeContext: %w", err)) } mainLog.Debug().Msgf("self-check against %q failed", selfCheckFQDN) return service.StatusUnknown