[issue6433] multiprocessing: pool.map hangs on empty list

Eric Eisner report at bugs.python.org
Tue Jul 7 13:39:04 CEST 2009


New submission from Eric Eisner <ede at mit.edu>:

In multiprocessing, if you give a pool.map a zero-length iterator and
specify a nonzero chunksize, the process hangs indefinitely. Example:

import multiprocessing
pool = multiprocessing.Pool()
pool.map(len, [], chunksize=1)
# hang forever

Attached simple testcase and simple fix. I observed this behavior on 2.6
and 3.1, but only verified the patch on 3.1. Unless the line numbers
changed it will probably fix it on 2.6 as well.

----------
components: Library (Lib)
files: map_testandfix.patch
keywords: patch
messages: 90228
nosy: ede
severity: normal
status: open
title: multiprocessing: pool.map hangs on empty list
type: crash
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file14467/map_testandfix.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6433>
_______________________________________


More information about the Python-bugs-list mailing list