[rhel7/master 0/2] Consolidate payload threads

David Shea dshea at redhat.com
Fri Aug 22 16:25:36 UTC 2014


This, I hope, fixes that weird bad file descriptor problem that we see
sometimes. We had yum environment parsing happening in two different
threads (one in the source spoke and one in the software spoke), and, since
we used two different threads for payload setup (one run from /sbin/anaconda
and one run from the source spoke), we didn't check always the status of both
of those threads everywhere that was needed, so the yum stuff could be accessed
from simultaneous threads.

The solution here is to get rid of the second payload thread entirely, and
consolidate all of the environment and group parsing into the main payload
thread. In order to set spoke statuses for the different spokes that use
payload data, there is a simple event registration framework in the new
payloadMgr object. So besides (hopefully!) fixing our strange, hard to
reproduce race condition, this gets of four copies of the same environment
parsing code (software+source x gui+tui).

The first patch is because, though I'm still not 100% sure how, I ended up with
threadMgr == None a couple of times in the new payload code. I suppose that
something went wrong with the order of module initialization, but you know,
threadMgr never actually has to be None and it's not very useful when it is.

Consolidating the threads (and the sources of error conditions) will also make
some changes needed for bug 1072619 easier, so that'll be nice.

David Shea (2):
  Initialize threading when the module is imported.
  Use one thread for payload setup.

 anaconda                                 |  13 +-
 pyanaconda/constants.py                  |   2 +-
 pyanaconda/packaging/__init__.py         | 202 +++++++++++++++++++++++++++++--
 pyanaconda/packaging/rpmostreepayload.py |   3 -
 pyanaconda/packaging/yumpayload.py       |   7 --
 pyanaconda/threads.py                    |   7 +-
 pyanaconda/ui/gui/spokes/network.py      |  11 +-
 pyanaconda/ui/gui/spokes/software.py     |  67 +++++-----
 pyanaconda/ui/gui/spokes/source.py       |  92 ++++++--------
 pyanaconda/ui/gui/spokes/storage.py      |   1 -
 pyanaconda/ui/tui/spokes/software.py     |  29 +----
 pyanaconda/ui/tui/spokes/source.py       |  38 ++----
 12 files changed, 287 insertions(+), 185 deletions(-)

-- 
1.9.3



More information about the anaconda-patches mailing list