Red Hat Bugzilla – Bug 246678
conduit.delPackage() extremely slow with newer yum
Last modified: 2014-01-21 17:58:37 EST
Description of problem:
The usage of the yum-priorities plugin (which extensively uses delPackage()) is
very difficult with the yum version bundled with Fedora 7. The issue doesn't
happen with the yum version included in Fedora Core 6.
I've added some python code in the plugin, to find that :
- Excluding ~3000 packages takes around 1 second with yum 3.0.6 (fc6)
- Excluding ~3000 packages takes more than 6 minutes with yum 3.2.0 (fc7). Same
issue with yum 3.2.1.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Add a couple of repositories that have a lot of overlapping packages (i.e.
dries, rpmforge, rpmfarm, freshrpms)
2. Install the yum-priorities plugin
3. # time yum install NonExistentPackage
Takes long minutes
Should take a couple of seconds
The problem is due to the fact that YumSqlitePackageSack.delPackage() now sets
self.pkglist to None, forcing yum to rebuild the pkglist at _each_ call to
delPackage(). If you have 3000 packages to exclude, you rebuild the entire
pkglist 3000 times, even if you don't use it between the delPackage() calls.
External bug reference:
About the attached patch:
This is not intended to be an out-of-the-box fix to the problem. Only a
workaround : it removes the offending line in delPackage() and delays the
pkglist rebuilding to right after the execution of the exclude_hook for the
plugins. The problem can probably be fixed in a more proper way.
Created attachment 158479 [details]
Dirty and temporary workaround
This is fixed in upstream and will be in 3.2.3