classification
Title: multiprocessing treats negative timeouts differently from before
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pitrou, python-dev, sbt
Priority: normal Keywords: patch

Created on 2012-05-08 14:58 by sbt, last changed 2012-05-10 19:42 by sbt. This issue is now closed.

Files
File name Uploaded Description Edit
neg-timeout.patch sbt, 2012-05-08 14:58 review
Messages (2)
msg160206 - (view) Author: Richard Oudkerk (sbt) * (Python committer) Date: 2012-05-08 14:58
In version 3.2 and earlier, Process.join() and Connection.poll() treat negative timeouts as zero timeouts.  (Thread.join() does the same.)

In the current 3.3 version, they treat negative timeouts as infinite timeouts.  Also multiprocessing.connection.wait() (new in 3.3) currently treats them as infinite on Unix and zero on Windows.

The attached patch fixes the regression with Process.join() and Connection.poll().  It also makes wait() treat negative timeouts as zero on both Windows and Unix.


It is worth noting that there is a fair amount of inconsistency in the handling of negative timeouts in the stdlib in 3.2:

Treat negative as infinite:
    select.select
    select.*.poll
    threading.*.acquire                   (new in 3.2)
    multiprocessing.dummy.*.acquire       (new in 3.2)

Treat negative as zero:
    threading.Thread.join
    threading.(Condition|Event).wait
    multiprocessing.Process.join
    multiprocessing.*.acquire
    multiprocessing.(Condition|Event).wait
    multiprocessing.Connection.poll
    multiprocessing.Queue.(get|put)
    concurrent.futures.Future.result
    concurrent.futures.wait

Treat negative as error:
    queue.Queue.(get|put)
    socket.socket.settimeout
msg160350 - (view) Author: Roundup Robot (python-dev) Date: 2012-05-10 15:13
New changeset 99ef4501205b by Richard Oudkerk in branch 'default':
Issue #14753: Make multiprocessing treat negative timeouts as it did in 3.2
http://hg.python.org/cpython/rev/99ef4501205b
History
Date User Action Args
2012-05-10 19:42:10sbtsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2012-05-10 15:13:31python-devsetnosy: + python-dev
messages: + msg160350
2012-05-08 14:58:06sbtcreate