Skip to content

Commit

Permalink
Merge pull request #84954 from melnikalex/automated-cherry-pick-of-#7…
Browse files Browse the repository at this point in the history
…8601-upstream-release-1.15

Automated cherry pick of #78601: change aws encryptedCheck to exponential backoff
  • Loading branch information
k8s-ci-robot committed Nov 9, 2019
2 parents 7b2582c + a272f54 commit bd88250
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions staging/src/k8s.io/legacy-cloud-providers/aws/aws.go
Expand Up @@ -225,12 +225,12 @@ const (
createTagFactor = 2.0
createTagSteps = 9

// encryptedCheck* is configuration of poll for created volume to check
// it has not been silently removed by AWS.
// volumeCreate* is configuration of exponential backoff for created volume.
// On a random AWS account (shared among several developers) it took 4s on
// average.
encryptedCheckInterval = 1 * time.Second
encryptedCheckTimeout = 30 * time.Second
// average, 8s max.
volumeCreateInitialDelay = 5 * time.Second
volumeCreateBackoffFactor = 1.2
volumeCreateBackoffSteps = 10

// Number of node names that can be added to a filter. The AWS limit is 200
// but we are using a lower limit on purpose
Expand Down Expand Up @@ -2442,8 +2442,13 @@ func (c *Cloud) waitUntilVolumeAvailable(volumeName KubernetesVolumeID) error {
// Unreachable code
return err
}

err = wait.Poll(encryptedCheckInterval, encryptedCheckTimeout, func() (done bool, err error) {
time.Sleep(5 * time.Second)
backoff := wait.Backoff{
Duration: volumeCreateInitialDelay,
Factor: volumeCreateBackoffFactor,
Steps: volumeCreateBackoffSteps,
}
err = wait.ExponentialBackoff(backoff, func() (done bool, err error) {
vol, err := disk.describeVolume()
if err != nil {
return true, err
Expand Down

0 comments on commit bd88250

Please sign in to comment.