Message324528
| Author |
tjb900 |
| Recipients |
tjb900 |
| Date |
2018年09月03日.15:53:21 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1535990001.55.0.56676864532.issue34572@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Retrieving and using a module directly from sys.modules (from C in this case) leads to a race condition where the module may be importing on another thread but has not yet been initialised. For slow filesystems or large modules (e.g. numpy) this seems to lead to easily reproducible errors (the attached code fails 100% of the time on my work machine - CentOS 7).
I believe they have to be in sys.modules during this phase due to the possibility of circular references.
importlib handles this carefully with locking, but _pickle.c bypasses all that, leading to issues with threaded codes that use pickling, e.g. dask/distributed. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2018年09月03日 15:53:21 | tjb900 | set | recipients:
+ tjb900 |
| 2018年09月03日 15:53:21 | tjb900 | set | messageid: <1535990001.55.0.56676864532.issue34572@psf.upfronthosting.co.za> |
| 2018年09月03日 15:53:21 | tjb900 | link | issue34572 messages |
| 2018年09月03日 15:53:21 | tjb900 | create |
|