Skip to content
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

Merged
merged 3 commits into from
Oct 8, 2019

Conversation

j-mracek
Copy link
Member

@j-mracek j-mracek commented Sep 20, 2019

Remove sleep step, retries download conditionally, and additional retries for mirrorlist and metalink

@j-mracek
Copy link
Member Author

j-mracek commented Oct 1, 2019

// 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)
Copy link
Contributor

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?

if (g_str_has_prefix(complete_path_or_baseurl, "file:/")) {
return FALSE;
}
if (download->allowed_mirror_failures > num_of_tried_mirrors) {
Copy link
Contributor

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.

@jrohel
Copy link
Contributor

jrohel commented Oct 8, 2019

@rh-atomic-bot r+

j-mracek and others added 3 commits October 8, 2019 12:13
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants