Bug 580377 - auto-update-debuginfo plugin calls doRepoSetup many times, which is slow
auto-update-debuginfo plugin calls doRepoSetup many times, which is slow
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: yum-utils (Show other bugs)
12
All Linux
low Severity low
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-08 02:38 EDT by Matt McCutchen
Modified: 2014-01-21 18:14 EST (History)
4 users (show)

See Also:
Fixed In Version: yum-utils-1.1.27-2.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-06-14 13:21:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Current yum output (3.08 KB, text/plain)
2010-04-08 02:45 EDT, Matt McCutchen
no flags Details
Yum output with my patch (2.05 KB, text/plain)
2010-04-08 02:45 EDT, Matt McCutchen
no flags Details
Patch that I am using (892 bytes, patch)
2010-04-08 02:47 EDT, Matt McCutchen
no flags Details | Diff
Analogous patch for debuginfo-install (1.36 KB, patch)
2010-04-15 19:43 EDT, Matt McCutchen
no flags Details | Diff

  None (edit)
Description Matt McCutchen 2010-04-08 02:38:21 EDT
Description of problem:
The auto-update-debuginfo plugin's postreposetup_hook calls doRepoSetup once after enabling each debuginfo repo.  This is inefficient because doRepoSetup calls all of the postreposetup hooks every time (including a reentrant call to the auto-update-debuginfo plugin, which fortunately does nothing because of the _done_plugin flag).  The design also feels wrong.

I have no prior experience hacking on yum, but I changed the auto-update-debuginfo hook to a prereposetup hook and removed the doRepoSetup call, and yum appeared to work correctly (and faster), including with --enablerepo or --disablerepo on the command line (bug 516254).

Version-Release number of selected component (if applicable):
yum-utils-1.1.26-1.fc12.noarch

How reproducible:
Always

Steps to Reproduce:
1. Make sure at least one debuginfo package is installed.  Also install the fastestmirror plugin.
2. yum list yum-utils

Actual results:
Other plugins' postreposetup hooks run many times.  (See output to be attached.)

Expected results:
Those hooks run only once.  (See output to be attached.)
Comment 1 Matt McCutchen 2010-04-08 02:45:33 EDT
Created attachment 405194 [details]
Current yum output
Comment 2 Matt McCutchen 2010-04-08 02:45:52 EDT
Created attachment 405196 [details]
Yum output with my patch
Comment 3 Matt McCutchen 2010-04-08 02:47:50 EDT
Created attachment 405197 [details]
Patch that I am using

This patch changes the hook to a prereposetup hook and makes some other cleanups.
Comment 4 James Antill 2010-04-08 10:19:35 EDT
What's the "time yum repolist" and/or "time yum list yum" in both cases?
Comment 5 Matt McCutchen 2010-04-08 10:57:47 EDT
The timings are at the end of each log.  But this is a design improvement regardless of the amount of speedup.
Comment 6 Matt McCutchen 2010-04-15 19:43:38 EDT
Created attachment 406963 [details]
Analogous patch for debuginfo-install

debuginfo-install could benefit from the same change.  The time saved is again about 3 seconds on my system.  Here is a patch that makes the change and also tweaks the logic to exactly match the auto-update-debuginfo plugin (namely, to not bother to re-enable already enabled repos).
Comment 7 James Antill 2010-04-20 12:24:38 EDT
Thanks for the patches, both are upstream now (although they needed a bit of tweaking due to changes ... feel free to test them!:)
Comment 8 Fedora Update System 2010-06-06 09:45:24 EDT
yum-utils-1.1.27-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/yum-utils-1.1.27-1.fc13
Comment 9 Fedora Update System 2010-06-08 15:35:49 EDT
yum-utils-1.1.27-2.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update yum-utils'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/yum-utils-1.1.27-2.fc13
Comment 10 Fedora Update System 2010-06-14 13:20:44 EDT
yum-utils-1.1.27-2.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

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