Bug 580377 - auto-update-debuginfo plugin calls doRepoSetup many times, which is slow
Summary: auto-update-debuginfo plugin calls doRepoSetup many times, which is slow
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: yum-utils
Version: 12
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-08 06:38 UTC by Matt McCutchen
Modified: 2014-01-21 23:14 UTC (History)
4 users (show)

Fixed In Version: yum-utils-1.1.27-2.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-14 17:21:47 UTC
Type: ---
Embargoed:


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

Description Matt McCutchen 2010-04-08 06:38:21 UTC
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 06:45:33 UTC
Created attachment 405194 [details]
Current yum output

Comment 2 Matt McCutchen 2010-04-08 06:45:52 UTC
Created attachment 405196 [details]
Yum output with my patch

Comment 3 Matt McCutchen 2010-04-08 06:47:50 UTC
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 14:19:35 UTC
What's the "time yum repolist" and/or "time yum list yum" in both cases?

Comment 5 Matt McCutchen 2010-04-08 14:57:47 UTC
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 23:43:38 UTC
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 16:24:38 UTC
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 13:45:24 UTC
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 19:35:49 UTC
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 17:20:44 UTC
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.