Issue 7707: multiprocess.Queue operations during import can lead to deadlocks (original) (raw)

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:56 admin set github: 51956
2012-04-28 23:29:12 pitrou set status: open -> closedresolution: fixedcomponents: + Documentation, - Library (Lib)stage: resolved
2012-04-28 23:23:44 hynek set nosy: + hynekmessages: +
2010-11-05 14:53:20 jnoller set messages: +
2010-09-22 19:19:58 asksol set files: + multiprocessing-issue7707.patchversions: + Python 3.1, - Python 2.6nosy: + asksolmessages: + keywords: + needs review, patch
2010-01-15 21:10:43 brett.cannon set assignee: jnollermessages: +
2010-01-15 17:26:15 r.david.murray set nosy: + brett.cannon, jnoller
2010-01-15 16:35:13 kripken create