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
retry toolchain update, only lock queue after 3 failed attempts #1789
Conversation
There shouldn't be, it's using |
@Nemo157 is anything missing here? I'm happy to add what's needed |
} | ||
} | ||
} | ||
unreachable!() |
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.
nit: you could avoid this by using loop
instead of for
src/build_queue.rs
Outdated
@@ -188,6 +188,27 @@ impl BuildQueue { | |||
} | |||
} | |||
|
|||
fn retry<T>(mut f: impl FnMut() -> Result<T>) -> Result<T> { | |||
const MAX_ATTEMPTS: u8 = 3; |
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.
If you're going to make retry
reusable, I would expect this to be a function parameter.
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 made this an parameter
for attempt in 1.. { | ||
match f() { |
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 retries immediately, right? shouldn't we wait between requests?
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.
Valid point 😄
( funny I didn't think of that, must have been a case of nightly blackout 😂)
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 added exponential sleep between the tries
4fc5afe
to
0f68a98
Compare
This is a simple attempt at solving #1787.
Since I don't know details about
update_toolchain
: are there any possible errors that might leave the toolchain in a broken state where a retry would make it worse?