[New-bugs-announce] [issue22853] Multiprocessing.Queue._feed deadlocks on import

Florian Finkernagel report at bugs.python.org
Wed Nov 12 13:29:31 CET 2014


New submission from Florian Finkernagel:

If you import a module that creates a multiprocessing.Queue, puts a value, and then waits for to be received again from the queue, you run into a deadlock.

The issue is that Queue._feed does 'from .util import is_existing' - which needs the import lock, but is still being held by the main thread.

Attached a script that illustrates this.

Patch is a two line change, import is_exiting in line 49, remove the import inside the thread:

49c49
< from multiprocessing.util import debug, info, Finalize, register_after_fork
---
> from multiprocessing.util import debug, info, Finalize, register_after_fork, is_exiting
232d231
<         from .util import is_exiting

----------
files: show_queue_import_bug.py
messages: 231073
nosy: ffinkernagel
priority: normal
severity: normal
status: open
title: Multiprocessing.Queue._feed deadlocks on import
versions: Python 2.7
Added file: http://bugs.python.org/file37185/show_queue_import_bug.py

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


More information about the New-bugs-announce mailing list