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: multiprocess.Queue operations during import can lead to deadlocks
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jnoller Nosy List: asksol, brett.cannon, hynek, jnoller, kripken
Priority: normal Keywords: needs review, patch

Created on 2010-01-15 16:35 by kripken, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test.py kripken, 2010-01-15 16:35 test cases
multiprocessing-issue7707.patch asksol, 2010-09-22 19:19
Messages (5)
msg97820 - (view) Author: Alon Zakai (kripken) Date: 2010-01-15 16:35
Creating a multiprocessing.Queue and operating on it while being imported can lead to a deadlock.

The attached file will work if run directly (python test.py) but will hang if imported from the interpreter (import test).

Additional comments are in the file.
msg97846 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2010-01-15 21:10
Without looking at the multiprocessing code I am willing to guess that some code in that run() function is launching some code that runs in a thread that is performing an import, deadlocking on the import lock. Jesse, is that what could be happening? If so we should probably add a note to the multiprocessing docs to not do this sort of stuff, ala http://docs.python.org/library/threading.html#importing-in-threaded-code .
msg117151 - (view) Author: Ask Solem (asksol) (Python committer) Date: 2010-09-22 19:19
I created a small doc patch for this (attached).
msg120504 - (view) Author: Jesse Noller (jnoller) * (Python committer) Date: 2010-11-05 14:53
Fine w/ committing this Ask.
msg159549 - (view) Author: Hynek Schlawack (hynek) * (Python committer) Date: 2012-04-28 23:23
The proposed patch has been committed as c4dcbe51c2e3 – any reasons why this issues is still open?
History
Date User Action Args
2022-04-11 14:56:56adminsetgithub: 51956
2012-04-28 23:29:12pitrousetstatus: open -> closed
resolution: fixed
components: + Documentation, - Library (Lib)
stage: resolved
2012-04-28 23:23:44hyneksetnosy: + hynek
messages: + msg159549
2010-11-05 14:53:20jnollersetmessages: + msg120504
2010-09-22 19:19:58asksolsetfiles: + multiprocessing-issue7707.patch
versions: + Python 3.1, - Python 2.6
nosy: + asksol

messages: + msg117151

keywords: + needs review, patch
2010-01-15 21:10:43brett.cannonsetassignee: jnoller
messages: + msg97846
2010-01-15 17:26:15r.david.murraysetnosy: + brett.cannon, jnoller
2010-01-15 16:35:13kripkencreate