-
Notifications
You must be signed in to change notification settings - Fork 42
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
extend standard retry with 429 http status code #2223
Conversation
This pull request does not have a backport label. Could you fix it @orouz? 🙏
|
📊 Allure Report - 💚 No failures were reported.
|
awsConfig.Retryer = func() aws.Retryer { | ||
return retry.NewStandard(func(o *retry.StandardOptions) { | ||
o.Retryables = append(o.Retryables, retry.RetryableHTTPStatusCode{ | ||
Codes: map[int]struct{}{ | ||
http.StatusTooManyRequests: {}, | ||
}, | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is essentialy the same as some AWS client does manually
} | ||
awsConfig.Region = metadata.Region |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all our AWS config initializations are done via libbeat. the only extra thing the config provider did was set the region. it was only used by EKS, which now sets the region itself
awsIdentityProvider: mockAwsIdentityProvider(errors.New("some error")), | ||
clientProvider: mockKubeClient(nil), | ||
awsMetadataProvider: mockMetadataProvider(errors.New("not this error")), // ignored | ||
awsMetadataProvider: mockMetadataProvider(nil), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to not err because EKS now sets the region itself via the metadata provider
Summary of your changes
this PR:
InitializeAWSConfig
function ends up returning anaws.Config
withRetryer
asnil
, so without adding it we're not opting-in to the default retry mechanism429
as an additional, retryable HTTP status code.Implementation notes
the first commit of this PR can be considered an alternative, standalone implementation of doing the same thing the 2nd commit does. the difference between the two, is that the 2nd commit removes the
ConfigProvider
in favor of a plain function to encapsulate AWS config initialization (via libbeat) + adding a retryer. to do so, some code was removed and now all AWS config initializations call the same function, and the only consumer of the now-deleted AWS config provider (EKS) sets the region manually (which is what the provider did)all in all - the 2nd commit's diff is bigger, but i think it does some nice cleanup too. although, we could go with the 1st if preferable.
Related Issues
Checklist