-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Infinite loop in url retry #21958
Comments
Can you check what your download attempts/delays are set to? And can you try removing retries? It might also be that the last retry just keeps going? https://www.pantsbuild.org/stable/reference/global-options#file_downloads_max_attempts I wonder if http_source bypasses it somehow. |
I'm using the default of 4 and 0.2
It appears to be related to the retry delay. If I only set file-downloads-max-attempts higher, it stalls out on the 4th request (which happens to be the default) Setting the delay lower however, it can progress past the 4th request and eventually complete. |
Added some logging to figure out what is going wrong, the exponential backoff is going a little haywire. replaced the jitter with this pub fn jitter(duration: Duration) -> Duration {
let r = rand::random::<f64>();
let m = duration.mul_f64(r);
log::debug!("Jitter random: {} old duration: {} new duration: {}", r, duration.as_millis(), m.as_millis());
return m;
}
|
The typical way I'm used to seeing exponential backoff work is described by aws here
So for a base of 200ms (ignoring the cap and jitter) The four attempts would be 200ms, 400ms, 800ms, 1600ms Instead, what we're seeing here is 200ms, 40000ms, 8000000ms, (presumably 1600000000ms) |
Good catch, that’s a ridiculous set of back off timings… |
I'm very new to rust, but I got it running #21959 Welcome your feedback 🙏 |
Required the update of tokio-retry to tokio-retry2 which is a fork of the original (which is now unmaintained?) The backoff algorithm is now sleep = random(0, base * 2 ** attempt) so they will approximate 200ms, 400ms, 800ms, 1600ms Previously it was sleep = random(0, base ** attempt) which was 200ms, 40000ms, 8000000ms, 1600000000ms
Required the update of tokio-retry to tokio-retry2 which is a fork of the original (which is now unmaintained?) The backoff algorithm is now sleep = random(0, base * 2 ** attempt) so they will approximate 200ms, 400ms, 800ms, 1600ms Previously it was sleep = random(0, base ** attempt) which was 200ms, 40000ms, 8000000ms, 1600000000ms
Describe the bug
I'm seeing bad urls (non-existant or return a bad status code) trigger an infinite loop, never times out or completes.
pants run :bad_file
Pants version
2.24.1
OS
Mac
Additional info
Possibly related to #21308
The text was updated successfully, but these errors were encountered: