On 26/03/2014 5:25pm, Guido van Rossum wrote:
- Looks like the signal handler is somehow inherited by the subprocess
created for the process pool?

It looks like ProcessPoolExecutor creates its workers lazily, so after you have changed the signal handlers for the main process. The workers are created using multiprocessing, which uses fork on Unix (at least by default), so they inherit the signal handlers.

You might try submitting a dummy task before modifying the signal handlers (although that will not help much if the workers have to be restarted).

In Python 3.4 you might try using

    multiprocessing.set_start_method('spawn')

or

    multiprocessing.set_start_method('forkserver')

This hopefully prevents the workers from inheriting anything troublesome from the main process.

-- Richard

Reply via email to