[New-bugs-announce] [issue17707] Multiprocessing queue get method does not block for short timeouts

Sultan Qasim report at bugs.python.org
Sat Apr 13 03:30:25 CEST 2013


New submission from Sultan Qasim:

This issue seems to be new in Python 3.3.1. This worked fine in Python 3.3.0 and earlier. I am using fully up-to-date installation of Arch Linux, running the official arch repo's 64 bit build of Python 3.3.1.
This issue is probably a result of the changes to multiprocessing's pipes brought about in solutions to issues #10527 or #16955.

The multiprocessing Queue's get() method on Python 3.3.1 does not block on Linux when a timeout of 1 second or less is specified. I have not tested this on Windows or Mac OS X.

Example Code:
from multiprocessing import Queue
q = Queue()

q.get(True, 0.5)
# Expected result: block for half a second before throwing exception
# Actual result: throws empty exception immediately without waiting

q.get(True, 1)
# Expected result: block for one second before throwing exception
# Actual result: throws empty exception immediately without waiting

q.get(True, 1.00001)
# Expected result: block for just over a second before throwing exception
# Actual result: throws empty exception immediately without waiting

q.get(True, 1.00002)
# Blocks for just over a second, as expected

q.get(True, 2)
# Blocks for two seconds, as expected

----------
components: Library (Lib)
messages: 186687
nosy: sultanqasim
priority: normal
severity: normal
status: open
title: Multiprocessing queue get method does not block for short timeouts
versions: Python 3.3

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


More information about the New-bugs-announce mailing list