-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Optimize OCI Implementation for Apps & Marketplace #45062
Optimize OCI Implementation for Apps & Marketplace #45062
Conversation
8c3a3e7
to
bd1842a
Compare
a5ca835
to
103f1fb
Compare
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.
Just need to remove the temporary commit before merging
419f8e5
to
5a5e777
Compare
var retryPolicy retry.GenericPolicy = retry.GenericPolicy{ | ||
Retryable: retry.DefaultPredicate, | ||
MinWait: 1 * time.Second, | ||
MaxWait: 5 * time.Second, | ||
MaxRetry: 5, | ||
} |
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.
When accessing a rate-limited server under distress we probably want to way longer before retrying. If I read this correctly, we would do our 6 requests in 20 seconds.
It is also worth checking the Retry-After header. If set, it can help us avoid prolonging the rate-limited state by not retrying when asked not to for a given period of time.
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.
One limitation here is that the retry is handled by the oras library, and afaik, we can't set one time for 429 and another for other errors. Regarding the header, oras handles it here
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.
Also @pjbgf those values are configurable by the user.
if o.exponentialBackOffValues != nil { | ||
if o.exponentialBackOffValues.MaxRetries > 0 { | ||
retryPolicy.MaxRetry = o.exponentialBackOffValues.MaxRetries | ||
} | ||
if o.exponentialBackOffValues.MaxWait != nil { | ||
retryPolicy.MaxWait = o.exponentialBackOffValues.MaxWait.Duration | ||
} | ||
if o.exponentialBackOffValues.MinWait != nil { | ||
retryPolicy.MinWait = o.exponentialBackOffValues.MinWait.Duration | ||
} | ||
} | ||
retryPolicy.Backoff = retry.ExponentialBackoff(retryPolicy.MinWait, 2, 0.2) | ||
|
||
retryTransport := retry.NewTransport(baseTransport) | ||
retryTransport.Policy = func() retry.Policy { | ||
return &retryPolicy | ||
} |
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 could keep the reconciliation loop busy just waiting. The retry policy could be combined with the reconciler's Result.RequeueAfter may enable a better use of resources.
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.
Yes @pjbgf We would like to work on iterations and use this comment as a feedback for improvement on the next PR.
cc @diogoasouza
Co-authored-by: Diogo Souza <[email protected]>
Co-authored-by: Diogo Souza <[email protected]>
Co-authored-by: Diogo Souza <[email protected]>
5a5e777
to
54cde74
Compare
UI Issue - rancher/dashboard#9815
Release Notes
Engineering Testing
QA Testing
Test Cases for QA Testing
Test Case Scenario - With Authentication
Test Case Scenario - Without Authentication
Test Case Scenario - Different fields of ClusterRepo