Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Shushlin <vshushlin@gitlab.com>2022-02-10 19:09:53 +0300
committerVladimir Shushlin <vshushlin@gitlab.com>2022-02-10 19:09:53 +0300
commitae8fbc5bf6725e6fa5b5a9dec6e4ac5016ec3c6c (patch)
treef62967094ef93f86abdd35389cd5bcd9b4249523
parent4be18c70ba9ddc62237dcf0a534c57540829cc9e (diff)
parent970531c7f80db47d209196921043aabcdf7590ef (diff)
Merge branch 'fix/retriever-leak' into 'master'
fix: do no retry resolving the domain if there's a ctx error See merge request gitlab-org/gitlab-pages!691
-rw-r--r--internal/source/gitlab/cache/retriever.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/source/gitlab/cache/retriever.go b/internal/source/gitlab/cache/retriever.go
index 65c7f1a2..68299f6c 100644
--- a/internal/source/gitlab/cache/retriever.go
+++ b/internal/source/gitlab/cache/retriever.go
@@ -78,6 +78,11 @@ func (r *Retriever) resolveWithBackoff(ctx context.Context, domainName string) <
break
}
+ if errors.Is(lookup.Error, context.Canceled) || errors.Is(lookup.Error, context.DeadlineExceeded) {
+ // do not retry if there's a context error to avoid leaking the goroutine
+ break
+ }
+
time.Sleep(r.maxRetrievalInterval)
}