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

Menno Smits menno-yum at freshfoo.com
Sun Mar 26 05:03:01 UTC 2006


Dan Williams wrote:
> 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.

The reason for this traceback is that populate() needs to be called
before you can write to options. You needed to set the option after
populate() was called on the EarlyConf instance.

Anyway this doesn't matter now because I've just committed changes that
avoid the above traceback and that should fix your threading issues
(along the lines of the "Potential Fix #1 mentioned in my last email).
Defaults are now copied at instantiation time. That means you can safely
change defaults without affecting other BaseConfig instances. I believe
this should address the problems you're having.

Let me know if it works for you.

Menno





More information about the Yum-devel mailing list