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: Unexpected blocking call to multiprocessing.Queue.get with a timeout
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: neologix, pitrou, python-dev, stacktic
Priority: normal Keywords: patch

Created on 2011-11-08 22:11 by stacktic, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
multiprocessing_queues.patch stacktic, 2011-11-08 22:11 Patch for Lib/multiprocessing/queues.py against HEAD review
Messages (3)
msg147319 - (view) Author: Arnaud Ysmal (stacktic) * Date: 2011-11-08 22:11
Using get(timeout=1) on a multiprocessing.Queue sometimes leads to a blocking get.

It seems that there is no check whether the timeout has expired after acquiring the lock but before the time.time(), which can cause a call to poll() with a negative timeout.

(patch attached)
msg147385 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-11-09 23:45
New changeset e7b6dca28a2f by Antoine Pitrou in branch '2.7':
Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
http://hg.python.org/cpython/rev/e7b6dca28a2f

New changeset 9328080a19c0 by Antoine Pitrou in branch '3.2':
Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
http://hg.python.org/cpython/rev/9328080a19c0

New changeset f34b4e250b44 by Antoine Pitrou in branch 'default':
Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
http://hg.python.org/cpython/rev/f34b4e250b44
msg147386 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-11-09 23:47
Patch committed, thank you for contributing!
History
Date User Action Args
2022-04-11 14:57:23adminsetgithub: 57582
2011-11-09 23:47:57pitrousetstatus: open -> closed
resolution: fixed
messages: + msg147386

stage: patch review -> resolved
2011-11-09 23:45:32python-devsetnosy: + python-dev
messages: + msg147385
2011-11-08 22:25:17pitrousetnosy: + pitrou
2011-11-08 22:23:03pitrousetnosy: + neologix
stage: patch review

versions: + Python 2.7, Python 3.2, Python 3.3
2011-11-08 22:11:27stackticcreate