[f20-branch/rhel7-branch] A bit of crazy magic for caching base repo

Vratislav Podzimek vpodzime at redhat.com
Wed Oct 16 13:32:17 UTC 2013


Getting base repo from yumpayload is potentially a very expensive operation (it
needs _yum_lock), but we need it quite often. To speed thinks up and prevent
hangs, we may cache base repo property and invalidate the value in cases that
may cause its change.

However, since all this may be happening from multiple threads and since in many
cases we don't care if the base repo is not set or not cached, the code needs to
use threads and locks. Optionally, some things may be made clearer by using
decorator for cache invalidation (i.e. the PATCH 2/3 may be dropped).

The result of the changes is bit smoother run of the GUI and open way to use
getBaseRepo method more often in text mode, which needs it to fix an unpleasant
bug with text mode never starting if repo is not specified in kickstart.

Vratislav Podzimek (3):
  Use cache for base repo if possible
  Use decorator for methods that invalidate base repo cache
  Make Software spoke ready even if there is no repo (#1010348)

 pyanaconda/constants.py              |   1 +
 pyanaconda/packaging/__init__.py     |  21 ++++++-
 pyanaconda/packaging/dnfpayload.py   |   4 +-
 pyanaconda/packaging/yumpayload.py   | 119 ++++++++++++++++++++++++++++++++---
 pyanaconda/ui/gui/spokes/network.py  |   4 +-
 pyanaconda/ui/gui/spokes/software.py |   2 +-
 pyanaconda/ui/gui/spokes/source.py   |  12 ++--
 pyanaconda/ui/gui/spokes/storage.py  |   2 +-
 pyanaconda/ui/tui/spokes/software.py |  21 +++++--
 pyanaconda/ui/tui/spokes/source.py   |   8 +--
 10 files changed, 162 insertions(+), 32 deletions(-)

-- 
1.7.11.7



More information about the anaconda-patches mailing list