-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
fix: retry module download once if server errored #17252
fix: retry module download once if server errored #17252
Conversation
@piscisaureus this link is not working for me, could you point to relevant line in code? |
cli/file_fetcher.rs
Outdated
FetchOnceResult::ServerError(status) => { | ||
// Retry once, and bail otherwise. | ||
if !retried { | ||
retried = true; |
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 do a slight delay when retrying? (maybe a few ms)
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.
Added 50ms delay.
let mut res = Response::new(Body::empty()); | ||
*res.status_mut() = StatusCode::INTERNAL_SERVER_ERROR; | ||
Ok(res) | ||
} |
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 add an endoint that errors the first time and succeeds the second?
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's gonna be hard to add state to that server to verify how many times this function was called...
cli/file_fetcher.rs
Outdated
// Retry once, and bail otherwise. | ||
if !retried { | ||
retried = true; | ||
continue; |
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.
Perhaps we should log::warn
when this occurs?
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.
Done
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.
Now that I'm thinking about it - a flake will cause this to be printed which will still fail tests. Maybe it should be log::debug
instead?
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. This will be a big improvement.
Closes #17251
Closes #19970