[issue12456] Hangs in concurrent.futures

Ross Lagerwall report at bugs.python.org
Fri Jul 1 07:25:23 CEST 2011


New submission from Ross Lagerwall <rosslagerwall at gmail.com>:

6d6099f7fe89 introduced a regression.

It causes the following code to hang fairly reliably for me:
"""
import concurrent.futures
import math

def is_prime(n):
    print(sqt(81))  <---- Note the type error!

def main():
    with concurrent.futures.ProcessPoolExecutor(2) as executor:
        executor.map(is_prime, [1, 2])

if __name__ == '__main__':
    main()
"""

>From my limited knowledge of multiprocessing and concurrent futures, it seems that in shutdown_worker(), call_queue.put(None) hangs because the queue is full and there are no more workers consuming items in the queue (they exited early).

Increasing EXTRA_QUEUED_CALLS fixes the problem, though its probably not the correct solution.

----------
components: Library (Lib)
messages: 139541
nosy: pitrou, rosslagerwall
priority: normal
severity: normal
status: open
title: Hangs in concurrent.futures
type: behavior
versions: Python 3.3

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


More information about the Python-bugs-list mailing list