[Yum-devel] Re: threading problem in config.py

Dan Williams dcbw at redhat.com
Thu Mar 23 20:26:59 UTC 2006


On Wed, 2006-03-22 at 14:19 -0500, seth vidal wrote:
> Hey Guys,
>  Dan Williams is spawning off multiple threads of YumBase from within
> plague and he's been running into some problems with some variables in
> the Config class overwriting later threads.
> 
> Specifically the installroot variable seems like it is getting stepped
> on between threads.
> 
> I'm not sure I know what to look for, though, for what could be causing
> the problem.
> 
> 
> Specifically Paul, Menno - Any suggestions on things I should look at?

<responding to Menno's email...>

First option, which was to do:

    earlyconf = EarlyConf()
    earlyconf.installroot = root

doesn't appear to work.  I get this traceback:

Exception in thread PackageJob: 1/ethtool:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/share/plague/server/PackageJob.py", line 86, in run
    self._pkg_job.process()
  File "/usr/share/plague/server/PackageJob.py", line 748, in process
    if func():
  File "/usr/share/plague/server/PackageJob.py", line 572, in _stage_depsolve
    if self._arch_deps_solved(arch) == False:
  File "/usr/share/plague/server/PackageJob.py", line 480, in _arch_deps_solved
    base.doConfigSetup(fn=yum_config, root=depsolve_root)
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 102, in doConfigSetup
    self.conf = config.readMainConfig(fn, root)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 563, in readMainConfig
    setattr(earlyconf, 'installroot', root)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 84, in __set__
    optdata = getattr(obj, self._attrname)
AttributeError: 'EarlyConf' object has no attribute '__opt-1213656884'

However, the second suggestion about setting it on yumconf does appear
to work, though it doesn't fix the real problem of being able to set
things on the EarlyConf object...  Patch attached for 2nd fix.

Dan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: yum-config-py-thread-workaround.patch
Type: text/x-patch
Size: 709 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20060323/97cd859d/attachment.bin 


More information about the Yum-devel mailing list