Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change aws encryptedCheck to exponential backoff #78601

Merged
merged 4 commits into from Jul 9, 2019
Merged

change aws encryptedCheck to exponential backoff #78601

merged 4 commits into from Jul 9, 2019

Conversation

rusik69
Copy link
Contributor

@rusik69 rusik69 commented May 31, 2019

What type of PR is this?

/kind feature

What this PR does / why we need it:
changing poll to exponential backoff for waiting to create encrypted aws volumes

Which issue(s) this PR fixes:
Fixes #77741

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 31, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @Loqutus. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 31, 2019
@rusik69
Copy link
Contributor Author

rusik69 commented May 31, 2019

/assign @gnufied

@k8s-ci-robot k8s-ci-robot added area/cloudprovider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 31, 2019
@gnufied
Copy link
Member

gnufied commented May 31, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 31, 2019
@jsafrane
Copy link
Member

jsafrane commented Jun 3, 2019

See #78596 - what numbers are better? Did anyone run some benchmark?

encryptedCheckInterval = 1 * time.Second
encryptedCheckTimeout = 30 * time.Second
// average, 8s max.
encryptedCheckInitialDelay = 1 * time.Second
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please rename the variables? They're used for generic volume creation check now.

@gnufied
Copy link
Member

gnufied commented Jun 3, 2019

I did some benchmarking btw. It looks like on average it takes on average between 5-6 seconds for volume to become available after creation. So, defaults proposed in this PR is not great.

I propose we change, default to:

	backoff := wait.Backoff{
		Duration: 5 * time.Second,
		Factor:   1.2,
		Steps:    10,
	}

The idea is - exponential backoff fires first call without wait and subsequent calls are more in line with expectation. Also this will cause the whole operation to wait for 129 seconds.

@gnufied
Copy link
Member

gnufied commented Jun 3, 2019

It might even be better to not poll volume immediately after creation at all because volume is never available immediately after creation. But I see that ExponentialBackoff does not offer a way to do that.

@gnufied
Copy link
Member

gnufied commented Jun 7, 2019

@Loqutus are you planning to fix this PR? It is something that I would prefer that we fix sooner than later.

@rusik69
Copy link
Contributor Author

rusik69 commented Jun 11, 2019

/retest

Copy link
Member

@bertinatto bertinatto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you squash the commits?

@@ -225,12 +225,13 @@ const (
createTagFactor = 2.0
createTagSteps = 9

// encryptedCheck* is configuration of poll for created volume to check
// volumeCreate* is configuration of exponential backoff for created volume to check
// it has not been silently removed by AWS.
// On a random AWS account (shared among several developers) it took 4s on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has not been silently removed by AWS

Seems like this is no longer accurate

Factor: volumeCreateBackoffFactor,
Steps: volumeCreateBackoffSteps,
}
err = wait.ExponentialBackoff(backoff, func() (done bool, err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might even be better to not poll volume immediately after creation at all because volume is never available immediately after creation. But I see that ExponentialBackoff does not offer a way to do that.

Yeah, that could save us a DescribeVolume request, which might be helpful for clusters hitting the AWS quota limit.

What if we use PollUntil instead? PollUntil waits the interval before firing the function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with adding time.Sleep(5 * time.Second) before proceeding with exponential backoff. It has same effect as anything else and works with exponential backoff..

@bertinatto
Copy link
Member

CC @leakingtapan

@gnufied
Copy link
Member

gnufied commented Jun 24, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 24, 2019
@rusik69
Copy link
Contributor Author

rusik69 commented Jul 8, 2019

/retest

@gnufied
Copy link
Member

gnufied commented Jul 8, 2019

Do you mind backporting this fix to 1.15 and 1.14 versions?

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gnufied, loqutus

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2019
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

3 similar comments
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit c88bda6 into kubernetes:master Jul 9, 2019
k8s-ci-robot added a commit that referenced this pull request Nov 8, 2019
…8601-upstream-release-1.14

Automated cherry pick of #78601: change aws encryptedCheck to exponential backoff
k8s-ci-robot added a commit that referenced this pull request Nov 9, 2019
…8601-upstream-release-1.15

Automated cherry pick of #78601: change aws encryptedCheck to exponential backoff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cloudprovider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EBS API polling when creating a volume
6 participants