Discussion:
[Scons-users] CacheDir race
David Siroky
2017-12-30 18:35:47 UTC
Permalink
Hi!

I'm running into following errors while using CacheDir and running
parallel jobs:

scons: *** [.....] AttributeError : 'EnvironmentError' object has no
attribute 'strerror'

scons: warning: Please upgrade your cache by running
scons-configure-cache.py /home/xxxx/.build_cache
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner

It happens only if the cache directory does not exist. I think the same
problem is described also here: http://bugs.nuitka.net/issue380

My working solution is to use a simple lock:
https://github.com/dsiroky/scons/commit/212fc5e8f35c98808a4275e00091f18d468e80af

Since there is a note about a hazard race I wonder - is the thread lock
good enough or are there any possible side effects?

Regards,
David
Bill Deegan
2017-12-30 22:12:40 UTC
Permalink
David,

Thanks for the thorough analysis in nuitka issue
Seems like a better fix would be to do the cachedir initialization outside
of the multi-threaded path.
(In SCons initiliiazation post SConstruct processing perhaps, but before
the tree walk..)

Can you think of any reason it needs to be done in the context where it
get's called on each thread?

-Bill
Post by David Siroky
Hi!
I'm running into following errors while using CacheDir and running
scons: *** [.....] AttributeError : 'EnvironmentError' object has no
attribute 'strerror'
scons: warning: Please upgrade your cache by running
scons-configure-cache.py /home/xxxx/.build_cache
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
It happens only if the cache directory does not exist. I think the same
problem is described also here: http://bugs.nuitka.net/issue380
https://github.com/dsiroky/scons/commit/212fc5e8f35c98808a42
75e00091f18d468e80af
Since there is a note about a hazard race I wonder - is the thread lock
good enough or are there any possible side effects?
Regards,
David
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
DS
2017-12-31 08:14:22 UTC
Permalink
I didn't do the analysis in nuitka issue. Kudos goes to someone else. I
just found it.

When the CacheDir statement is invoked in SConstruct then it is already
running in parallel. My only reason to place the lock to the CacheDir
constructor is that I don't know any other suitable place. However it
does not mean there isn't any other. I just don't know the architecture
well.

David
Post by Bill Deegan
David,
Thanks for the thorough analysis in nuitka issue
Seems like a better fix would be to do the cachedir initialization outside of
the multi-threaded path.
(In SCons initiliiazation post SConstruct processing perhaps, but before the
tree walk..)
Can you think of any reason it needs to be done in the context where it get's
called on each thread?
-Bill
Hi!
I'm running into following errors while using CacheDir and running parallel
scons: *** [.....] AttributeError : 'EnvironmentError' object has no
attribute 'strerror'
scons: warning: Please upgrade your cache by runningĀ 
scons-configure-cache.py /home/xxxx/.build_cache
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
It happens only if the cache directory does not exist. I think the same
problem is described also here: http://bugs.nuitka.net/issue380
https://github.com/dsiroky/scons/commit/212fc5e8f35c98808a42
75e00091f18d468e80af
Since there is a note about a hazard race I wonder - is the thread lock
good enough or are there any possible side effects?
Regards,
David
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Loading...