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.

classification
Title: Incorrect pool.py distributed with Python 2.7 windows 32bit
Type: behavior Stage: resolved
Components: Windows Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Aaron.Staley, jnoller
Priority: normal Keywords:

Created on 2011-10-05 02:11 by Aaron.Staley, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg144934 - (view) Author: Aaron Staley (Aaron.Staley) Date: 2011-10-05 02:11
The multiprocess/pool.py distributed with the Python 2.7.2 Windows Installer is different from the one distributed with the 64 bit windows installer or source tarball - and is buggy.

Specifically, see Pool._terminate_pool:


    def _terminate_pool(cls, taskqueue, inqueue, outqueue, pool,
                        worker_handler, task_handler, result_handler, cache):
        # this is guaranteed to only be called once
        debug('finalizing pool')

        worker_handler._state = TERMINATE
        task_handler._state = TERMINATE
        taskqueue.put(None)                 # THIS LINE MISSING!


Without that line, termination may deadlock during Pool._help_stuff_finish.  The consequence to the user is the interpreter not shutting down.
msg144949 - (view) Author: Aaron Staley (Aaron.Staley) Date: 2011-10-05 11:41
Never mind; looks like this functionality was moved to handle_workers. I had inadvertently been testing under a modified pool.py.

Sorry for the inconvenience!
History
Date User Action Args
2022-04-11 14:57:22adminsetgithub: 57315
2011-10-05 11:45:42ezio.melottisetstage: test needed -> resolved
2011-10-05 11:41:10Aaron.Staleysetstatus: open -> closed
resolution: not a bug
messages: + msg144949
2011-10-05 04:25:17ezio.melottisetnosy: + jnoller

type: behavior
stage: test needed
2011-10-05 02:11:48Aaron.Staleycreate