This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: possible typo in multiprocessing.Pool._terminate
Type: Stage: resolved
Components: Versions: Python 3.1, Python 3.2, Python 3.3
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asksol, jnoller, pitrou, python-dev
Priority: normal Keywords:

Created on 2011-04-09 23:07 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg133433 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-04-09 23:07
There's the following code in, line 494 and following:

        debug('joining task handler')

        debug('joining result handler')

It seems the last line should read `result_handler.join()` instead.

Additionally, when _terminate() is called, it seems the worker_handler could still run while other threads shut down existing workers, meaning it could start new workers (in _repopulate_pool()) in parallel.

So perhaps the worker_handler should be joined before anything else in _terminate(). It would incur a small latency, though (because of the sleep() call there).
msg133486 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-04-10 22:23
New changeset c046b7e1087b by Antoine Pitrou in branch '3.2':
Issue #11814: Fix likely typo in multiprocessing.Pool._terminate().

New changeset 76a3fc180ce0 by Antoine Pitrou in branch 'default':
Merge from 3.2 (issue #11814, issue #8428)
msg133489 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-04-10 22:31
Fixed. The _terminate() issue has been fixed separately in issue8428.
Date User Action Args
2022-04-11 14:57:16adminsetgithub: 56023
2011-04-10 22:31:25pitrousetstatus: open -> closed
resolution: fixed
messages: + msg133489

stage: resolved
2011-04-10 22:23:30python-devsetnosy: + python-dev
messages: + msg133486
2011-04-09 23:07:20pitroucreate