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

Fix/verify rate limits #81

Merged
merged 1 commit into from Aug 27, 2020
Merged

Fix/verify rate limits #81

merged 1 commit into from Aug 27, 2020

Conversation

boranx
Copy link
Member

@boranx boranx commented Aug 12, 2020

Fixes: OSD-4671

I've realized a Retryer: client.DefaultRetryer was defined but NumMaxRetries was missing. By default, the value is 0 which means there will be no retry unless we increase the number.
Results are looking good, I've tested it in while loop on 5 different tabs, didn't see any 400 but responses may take longer as a result of retry mechanism.

@georgettica
Copy link

nice change! should there be tests for this code segment?

@boranx
Copy link
Member Author

boranx commented Aug 12, 2020

for checkPermissionsUsingQueryClient and related functions, there are no tests but I can add! That would be a nice value-adding

@vkareh
Copy link
Member

vkareh commented Aug 12, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2020
@boranx
Copy link
Member Author

boranx commented Aug 12, 2020

/hold
Adding unit tests for the components

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 12, 2020
@@ -140,6 +140,7 @@ func (b *ClientBuilder) Build() (Client, error) {
MaxRetries: aws.Int(25),
// Set MinThrottleDelay to 1 second
Retryer: client.DefaultRetryer{
NumMaxRetries: 5,
Copy link
Contributor

Choose a reason for hiding this comment

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

I could have been sure that I added this initially! Thanks. Though the hack day testing we found that retrying didn't always resolve the issue its annoying how inconsistent this is. Did you try with another AWS account?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've tested it with 2 different accounts. One is my personal and the other what @fahlmant gave me. The retry is not a permanent solution I agree, but still, the number of 400s significantly reduced(I didn't see in the logs any but still can occur..). Having said that, there's no response code that resp contains (resp, err := client.iamClient.SimulatePrincipalPolicy(input)) It only fills the err message with status code when anything happens except 200. Because of that, it's hard to adjust the retry numbers dynamically if continuously 400 happens

Copy link
Member Author

Choose a reason for hiding this comment

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

what could be the other alternatives? We're making a single request for policy checks so I don't think we can reduce the number of requests at all.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok no problem, lets see how thing goes and look at it closer if we continue to see rate limiting errors.

pkg/aws/permissions.go Outdated Show resolved Hide resolved
pkg/aws/permissions.go Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 13, 2020
@boranx
Copy link
Member Author

boranx commented Aug 13, 2020

/unhold

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 13, 2020
@vkareh
Copy link
Member

vkareh commented Aug 18, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 18, 2020
@vkareh
Copy link
Member

vkareh commented Aug 18, 2020

@jharrington22 - you had a change request earlier, does this lgty now?

@jharrington22 jharrington22 merged commit 387347d into openshift:master Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants