[New-bugs-announce] [issue12488] multiprocessing.Connection does not communicate pipe closure between parent and child

Luke report at bugs.python.org
Mon Jul 4 13:43:29 CEST 2011


New submission from Luke <lcampagn at email.unc.edu>:

I have found that when using multiprocessing.Connection objects to pass data between two processes, closing one end of the pipe is not properly communicated to the other end. My expectation was that when calling recv() on the remote end, it should raise EOFError if the pipe has been closed. Instead, the remote recv() blocks indefinitely. This behavior exists on Linux and Cygwin, but NOT on native Windows.

Example:

    import multiprocessing as m

    def fn(pipe):
        print "recv:", pipe.recv()
        print "recv:", pipe.recv()

    if __name__ == '__main__':
        p1, p2 = m.Pipe()
        pr = m.Process(target=fn, args=(p2,))
        pr.start()
        p1.send(1)
        p1.close()  ## should generate EOFError in remote process

----------
messages: 139754
nosy: lcampagn
priority: normal
severity: normal
status: open
title: multiprocessing.Connection does not communicate pipe closure between parent and child
type: behavior
versions: Python 2.7

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


More information about the New-bugs-announce mailing list