-
Notifications
You must be signed in to change notification settings - Fork 181
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
new customizable retry logic introduced unnecessary retries and retry_check is not executed #988
Comments
oops! looks like a typo, @quinnj ? i.e. we meant - retry = retryable(req) || retryablebody(req) && _retry_check(s, ex, req, retry_check)
+ retry = (retryable(req) || retryablebody(req)) && _retry_check(s, ex, req, retry_check) What we have: julia> for (x, y) in (
(true, true),
(true, false),
(false, true),
(false, false),
)
@show x, y
x || y && println(" yes!")
end
(x, y) = (true, true)
(x, y) = (true, false)
(x, y) = (false, true)
yes!
(x, y) = (false, false) what we want: julia> for (x, y) in (
(true, true),
(true, false),
(false, true),
(false, false),
)
@show x, y
(x || y) && println(" yes!")
end
(x, y) = (true, true)
yes!
(x, y) = (true, false)
yes!
(x, y) = (false, true)
yes!
(x, y) = (false, false) |
Many thanks for the quick response. But I doubt that this is all about it. If
Which basically means, that by default there are no retires at all, since Please don't forget about the other subissues which are related and somehow influenced by your proposal:
|
ah, yeah, that But even still, having thought about it, i relise i think i just misunderstood the goal of Probably best we wait for Jacob to answer this one 😊 |
I think this pull request could be helpful. |
This is correct. The idea is that there is a default set of cases defined by the HTTP spec that dictate whether you should retry or not. Those are covered by |
I'm still not sure if the problem is understood. A little example:
causes a 400 status exception. But it retries unnecessarily 4 times which takes altogether almost 10s. Which HTTP Spec dictates this retry? The old implementation would have avoided retries on 400.
which is not working. The best I can do is to reduce it to one retry on 400 while keeping 4 retries on all others:
It really doesn't look intentional to me, are you really happy with this idea? |
There was indeed a bug from the new |
Thanks for solving the main issue and reflecting the behaviour in the docs. I still would like to promote my pull request, because it also ensures expected behaviour (esp.
On top of this we should not rely on a spec-compliant server behaviour. That said, I would be glad if we could treat that status-list as a "may-retry" or "recovery-is-likely-list" and 403 should be removed anyway (I'm not sure about 500). An usage example for opt-out 408, 409 and opt-in 404 combined with a custom retry_delay-setting could look like this:
May be you could have a second thought on this. |
This commit aimed to provide a customizable retry logic. It can be seen in line 48, that the new
retry_check
function is only executed ifretryable(req)
returnsfalse
:But with default arguments on
retry_delays
andretries
,retryable(req)
is typicallytrue
.An ugly workaround to make
retry_check
accessible is this:I think those changes are critical since by default there are no further retry checks anymore, which causes a lot of unnecessary time-consuming retries.
Was it actually intended that neither the response status is checked with "retryable" nor all the other possibilities ("isrecoverable") that make a recovery very unlikely?
What is actually the use of the
retryattempt[]
counter, because the ExponentialBackOff iterator is already limiting the number of retries?The text was updated successfully, but these errors were encountered: