RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1428210 - yum retrieves metadata of the slow repository before detecting the fastest mirror by fastestmirror plugin
Summary: yum retrieves metadata of the slow repository before detecting the fastest mi...
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum-utils
Version: 7.3
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Michal Domonkos
QA Contact: Eva Mrakova
Lucie Vařáková
Depends On:
Blocks: 1420851 1465896 1466368 1473733
TreeView+ depends on / blocked
Reported: 2017-03-02 02:11 UTC by Masahiro Matsuya
Modified: 2020-04-15 15:25 UTC (History)
9 users (show)

Fixed In Version: yum-utils-1.1.31-43.el7
Doc Type: Release Note
Doc Text:
The *fastestmirror* plug-in now orders mirrors before the metadata download Previously, when the *yum* installer ran for the first time after a cache cleanup, the *fastestmirror* plug-in did not select the fastest mirror before metadata download. This sometimes caused a delay if some mirrors were slow or unavailable. With this update, the *fastestmirror* plug-in has been modified to have effect on mirror selection before metadata download. As a result, the mirrors are polled and arranged before metadata download, which prevents such delays.
Clone Of:
Last Closed: 2018-04-10 16:50:32 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 999489 0 unspecified CLOSED Yum ignores fastestmirror 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1038210 0 unspecified CLOSED install yum-plugin-fastestmirror by default 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2018:0919 0 None None None 2018-04-10 16:51:59 UTC

Internal Links: 999489 1038210

Description Masahiro Matsuya 2017-03-02 02:11:50 UTC
Description of problem:

A customer is using fastestmirror plugin to detect the fastest mirror in the list.
In RHEL6, the detection was done before retrieving the metadata or all repositories, so it just could retrieve the metadata from the fastest one only.
In RHEL7, the metadata is retrieved before the detection, so it tries to retrieve the metadata from a slower mirror. When some mirrors in the list are not available, it makes a delay until finding the usable mirror.

This looks related with [1]. The change was not in RHEL6, but it's in RHEL7.
The customer tested the following change in /usr/lib/python2.7/site-packages/yum/repos.py. This is just for testing. 

    def doSetup(self, thisrepo = None):
         self._setup = True


    def doSetup(self, thisrepo = None):
         self._setup = True

And, they confirmed that the problem was fixed.
The comment in [1] says that 
  "Metadata are downloaded in parallel just before postreposetup."

So, it seems that inserting self.retrieveAllMD() just before self.ayum.plugins.run('postreposetup') was by design. I'm not sure the reason, but any plugin requires that?

Can we fix this problem in yum side?

[1] http://yum.baseurl.org/gitweb?p=yum.git;a=commitdiff;h=a522869c21768d53c3861be9c0a2394a3930ad66

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 7

How reproducible:

Steps to Reproduce:
1. configure yum repositiry mirrors (some mirrors are not reachable)
2. configure fastestmirror plugin
3. run 'yum clean all' and 'yum repolist'

Actual results:
It tries to retrieve metadata from slower mirror.

# yum repolist
Loaded plugins: fastestmirror, langpacks                                      
http://test1.example.com/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://test1.example.com/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30002 milliseconds')                              
Trying other mirror.

Expected results:
It can retrieve the metadata from the fastest mirror soon as done in RHEL6.

Additional info:
Looks a regression from RHEL6.

Comment 18 errata-xmlrpc 2018-04-10 16:50:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.