We recently switched to thrift 0.10.0 with accelerated protocols and started seeing ExtractionError being sporadically raised in tests that use the accelerated protocols (fastbinary module) and multiprocessing module. Example traceback:
There is a MWE using Docker at https://github.com/cjmay/thrift-4042 . I reproduced the error on the first run, but you may need to try several runs to reproduce it as it is a race condition.
This bug only happens when using the new accelerated protocol in thrift 0.10.0 and only happens when thrift has been installed as an egg. When the accelerated protocol is used the fastbinary module is extracted from the installed thrift egg to the Python egg cache. I believe the extraction of the module file itself is atomic (using the rename syscall) but the creation of its parent directory is non-atomic and sometimes results in an error if the fastbinary module is loaded simultaneously by several processes. Note this only occurs the first time the module is loaded, as after that point the parent directory already exists. (This is the justification for using Docker for the MWE.)
I believe this is the same error as:
The documentation indicates we can prevent packaging the module into an egg by setting zip_safe to False in setup.py:
I tried this in the repository linked above and it worked. There are public builds demonstrating it: https://travis-ci.org/cjmay/thrift-4042