We managed to get a fun stacktrace on a node that was simultaneously 
generating the bytecode cache and another process that was trying to read 
it.

Looking at class FileSystemBytecodeCache in bccache.py, I think this 
would've been avoided if the dump_bytecode function wrote to a tmp file and 
then did an atomic rename, e.g. something like:

    def dump_bytecode(self, bucket):
        _cache_file = self._get_cache_filename(bucket)
        _cache_tmp_file = os.path.join(_cache_file, '-tmp-%s' % os.getpid())
        f = open(_cache_tmp_file, 'wb')
        try:
            bucket.write_bytecode(f)
            os.rename(_cache_tmp_file, _cache_file)
        finally:
            f.close()

Thoughts?

-Jeff

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pocoo-libs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to