[pypy-issue] [issue1289] multiprocessing Pool + maxtasksperchild + signal = ValueError

Amaury Forgeot d Arc tracker at bugs.pypy.org
Tue Oct 16 00:23:53 CEST 2012


Amaury Forgeot d Arc <amauryfa at gmail.com> added the comment:

- Why "maxtasksperchild"?  Because Pool.__init__ will spawn the first worker process, and this 
one works, but after the worker process exits, additional workers are spawned from a separate 
thread (see the call to pool._maintain_pool() in multiprocessing/pool.py)

- So the problem is that fork() from a thread does not reinitialize the interpreter correctly. 
in our case, the idea of "main thread" of the signal module must be reset; also, threadlocal 
values should be discarded.

Here is a patch with tests. Armin, could you please review it?

----------
assignedto:  -> arigo
nosy: +afa, arigo
status: unread -> chatting

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1289>
________________________________________


More information about the pypy-issue mailing list