-
Notifications
You must be signed in to change notification settings - Fork 87
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
Add sleep conditionally (RhBug:1741931) #169
Conversation
f1762df
to
0cb0c62
Compare
0cb0c62
to
17bc92f
Compare
Related bug: https://bugzilla.redhat.com/show_bug.cgi?id=1756400 |
// Iterate over mirror for the target | ||
for (GSList *elem = target->lrmirrors; elem; elem = g_slist_next(elem)) { | ||
LrMirror *c_mirror = elem->data; | ||
gchar *mirrorurl = c_mirror->mirror->url; | ||
|
||
// first iteration, filter out mirrors that failed previously | ||
if (mirrors_iterated == 0) { | ||
if (c_mirror->mirror->protocol != LR_PROTOCOL_FILE) |
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.
So, if one of mirror is not local then reiteration is enabled. But then local paths are retried too, isn't it? You wrote "retry local paths nave no reason" above. I think you forgot add condition code at line 743.
} else if (c_mirror->mirror->protocol == LR_PROTOCOL_FILE) {
continue;
Or am I misunderstand the code?
librepo/downloader.c
Outdated
if (g_str_has_prefix(complete_path_or_baseurl, "file:/")) { | ||
return FALSE; | ||
} | ||
if (download->allowed_mirror_failures > num_of_tried_mirrors) { |
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.
Next 4 lines do the same as the original one line code.
This is a performance improvement when local repository is not accessible. The sleep step was removed because in case of broken IP from DNS it always tries same IP anyway.
It is required for debugging connection issue and with DNS redirections.
Previously librepo did only one attempt to download the mirror files. And because especially Fedora metalink urls are nowadays by default downloaded from 'mirrors.fedoraproject.org' host - which is just a CNAME to set of DNS-load balanced proxies - it not unlikely that librepo would ask some temporarily broken proxy. Several attempts though will usually mean that librepo will approach several different proxies. In manual dnf-workflow, user would just re-try the whole dnf command manually, but in build systems like Copr [1] this causes severe problems and random build failures. [1] https://pagure.io/fedora-infrastructure/issue/7987
Remove sleep step, retries download conditionally, and additional retries for mirrorlist and metalink