Skip to content

Commit

Permalink
Decrease Factor to 5.0 seconds and increase steps
Browse files Browse the repository at this point in the history
This way we get more retries and the maximum wait time is 1 hour
after which the run will fail.
  • Loading branch information
klemmari1 committed Oct 24, 2023
1 parent b2e4df5 commit e1e7829
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/gcrane/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down

0 comments on commit e1e7829

Please sign in to comment.