mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #78601 from loqutus/aws-encrypted-check-exponential-backoff
change aws encryptedCheck to exponential backoff
This commit is contained in:
commit
c88bda6a20
@ -231,12 +231,12 @@ const (
|
|||||||
createTagFactor = 2.0
|
createTagFactor = 2.0
|
||||||
createTagSteps = 9
|
createTagSteps = 9
|
||||||
|
|
||||||
// encryptedCheck* is configuration of poll for created volume to check
|
// volumeCreate* is configuration of exponential backoff for created volume.
|
||||||
// it has not been silently removed by AWS.
|
|
||||||
// On a random AWS account (shared among several developers) it took 4s on
|
// On a random AWS account (shared among several developers) it took 4s on
|
||||||
// average.
|
// average, 8s max.
|
||||||
encryptedCheckInterval = 1 * time.Second
|
volumeCreateInitialDelay = 5 * time.Second
|
||||||
encryptedCheckTimeout = 30 * time.Second
|
volumeCreateBackoffFactor = 1.2
|
||||||
|
volumeCreateBackoffSteps = 10
|
||||||
|
|
||||||
// Number of node names that can be added to a filter. The AWS limit is 200
|
// 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
|
// but we are using a lower limit on purpose
|
||||||
@ -2448,8 +2448,13 @@ func (c *Cloud) waitUntilVolumeAvailable(volumeName KubernetesVolumeID) error {
|
|||||||
// Unreachable code
|
// Unreachable code
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
time.Sleep(5 * time.Second)
|
||||||
err = wait.Poll(encryptedCheckInterval, encryptedCheckTimeout, func() (done bool, err error) {
|
backoff := wait.Backoff{
|
||||||
|
Duration: volumeCreateInitialDelay,
|
||||||
|
Factor: volumeCreateBackoffFactor,
|
||||||
|
Steps: volumeCreateBackoffSteps,
|
||||||
|
}
|
||||||
|
err = wait.ExponentialBackoff(backoff, func() (done bool, err error) {
|
||||||
vol, err := disk.describeVolume()
|
vol, err := disk.describeVolume()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return true, err
|
return true, err
|
||||||
|
Loading…
Reference in New Issue
Block a user