From e1e7829aefa347ec08b4c78fd6a2896444e03ac3 Mon Sep 17 00:00:00 2001 From: Kristian Klemets Date: Tue, 24 Oct 2023 12:17:07 +0300 Subject: [PATCH] Decrease Factor to 5.0 seconds and increase steps This way we get more retries and the maximum wait time is 1 hour after which the run will fail. --- pkg/gcrane/copy.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/gcrane/copy.go b/pkg/gcrane/copy.go index 935a48771..e5151bd3b 100644 --- a/pkg/gcrane/copy.go +++ b/pkg/gcrane/copy.go @@ -45,17 +45,19 @@ var Keychain = authn.NewMultiKeychain(google.Keychain, authn.DefaultKeychain) // - 1M requests per 24 hours. // // On error, we will wait for: -// - 9 seconds (in case of very short term 429s from GCS), then -// - 1.5 minutes (in case of temporary network issues), then -// - 15 minutes (to get around GCR 10 minute quotas), then fail. +// - 6 seconds (in case of very short term 429s from GCS), then +// - 30 seconds (in case of very short term 429s from GCS), then +// - 2.5 minutes (in case of temporary network issues), then +// - 12.5 minutes (to get around GCR 10 minute quotas), then +// - 1 hour (in case of longer term network issues), then fail. // // TODO: In theory, we could keep retrying until the next day to get around the 1M limit. func GCRBackoff() retry.Backoff { return retry.Backoff{ - Duration: 9 * time.Second, - Factor: 10.0, + Duration: 6 * time.Second, + Factor: 5.0, Jitter: 0.1, - Steps: 4, + Steps: 6, Cap: 1 * time.Hour, } }