Message163101
| Author |
sbt |
| Recipients |
sbt |
| Date |
2012年06月18日.14:33:39 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1340030021.48.0.355749717921.issue15101@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Multiprocessing's process pool originally used a finalizer to shutdown the pool when the pool object is garbage collected.
Since the maxtasksperchild feature was added, the worker_handler thread holds a reference to the pool, preventing garbage collection at least until that thread finished.
In some cases the last reference to the pool is owned by the worker_handler thread, and as it exits, the finalizer is triggered. Since the finalizer tries to join the worker_handler thread, an error will be raised since a thread cannot join itself.
It would have been better if pools had used the context manager protocol rather than using RAII -- see Issue #15064.
Unless/until RAII usage is fixed, a quick fix would be to just make the finalizer skip trying to join the current thread. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年06月18日 14:33:41 | sbt | set | recipients:
+ sbt |
| 2012年06月18日 14:33:41 | sbt | set | messageid: <1340030021.48.0.355749717921.issue15101@psf.upfronthosting.co.za> |
| 2012年06月18日 14:33:40 | sbt | link | issue15101 messages |
| 2012年06月18日 14:33:39 | sbt | create |
|