From 7f3621e980c3d0d7171db5ff2cd2f307a10727d4 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 11 Nov 2021 21:26:11 +0100 Subject: [PATCH] Fix broken retry mechanics dc7511c introduced a parent context check to suppress logging if it was canceled. If it was not canceled, the check overwrites the variable err, which resets every previous real error to nil, which then leads to fatals because the OnError callback or the IsRetryable function expect a non-nil error. Since I cannot reproduce which logs should have been suppressed by the changes, I removed them completely. --- pkg/retry/retry.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/retry/retry.go b/pkg/retry/retry.go index 0ebae3c2..29faf8a7 100644 --- a/pkg/retry/retry.go +++ b/pkg/retry/retry.go @@ -48,10 +48,6 @@ func WithBackoff( return } - if err = parentCtx.Err(); err != nil { - return - } - if settings.OnError != nil { settings.OnError(time.Since(start), attempt, err, prevErr) }