[issue14753] multiprocessing treats negative timeouts differently from before

Richard Oudkerk report at bugs.python.org
Tue May 8 16:58:08 CEST 2012


New submission from Richard Oudkerk <shibturn at gmail.com>:

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

----------
components: Library (Lib)
files: neg-timeout.patch
keywords: patch
messages: 160206
nosy: pitrou, sbt
priority: normal
severity: normal
stage: patch review
status: open
title: multiprocessing treats negative timeouts differently from before
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file25497/neg-timeout.patch

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


More information about the Python-bugs-list mailing list