-
Notifications
You must be signed in to change notification settings - Fork 13
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
use retry after instead of calculating delay #166
Conversation
@@ -112,7 +112,7 @@ func handleRequestError( | |||
case let .retryWithBackoff(requestCount, totalCount, _): | |||
requestRetryCount = requestCount + 1 | |||
totalRetryCount = totalCount + 1 | |||
nextBackoff = getDelaySeconds(for: totalRetryCount) | |||
nextBackoff = retryAfter ?? getDelaySeconds(for: totalRetryCount) |
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.
Should we apply jitter to the retryAfter
too?
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.
I suppose if we needed jitter, the server could apply it.
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.
@jason-myers-klaviyo do you have any opinion on whether the SDKs should apply a jitter on top of the Retry-After
value? Does the Retry-After
just represent the time till the steady state rate limit "resets" or is there more advanced logic to it?
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.
Jitter longer than the seconds given would be fine and up to you. Nice to have I think
Jitter shorter will cause another 429 I think
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.
It is just the time until the steady windows reset IIRC
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.
Oh ya definitely only add jitter
For viz, the relevant android PR |
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.
Add jitter (1-10s?) to server's Retry-After
value
Added jitter to |
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.
LGTM, just confirming if its been tested against a live 429 response from production
Description
Check List
Manual Test Plan
Supporting Materials