[Twisted-Python] linux kernel 2.6.11-rc broke twisted process pipes

Andrea Arcangeli andrea at suse.de
Mon Feb 28 15:14:48 EST 2005


Hello everyone,

Please read the attached emails.

I would like to understand exactly what broke twisted, so that we're
sure the new 2.6.11 kernel will work reliably with twisted.

This code especially will never trigger with 2.6.11 because we'll never
set POLLIN|POLLOUT at the same time for writeable fd.

    def doRead(self):
        """The only way this pipe can become readable is at EOF, because the
        child has closed it.
        """
        fd = self.fd
        r, w, x = select.select([fd], [fd], [], 0)
        if r and w:
            return CONNECTION_LOST

Could you answer why anybody should call doRead on a writeable fd?

Where is it written that at EOF a _write_ pipe channel becomes readable?

Is it ok that "r and w" will never trigger at the same time anymore,
right? Was just that a superflous assumptions?

Note that with 2.6.8 and all previous linux kernels, "r and w" could be
== True in normal conditions too if the pipe write buffer was empty (old
kernel was setting pollin always for no good reason).

What I suspect is that the above is a superflous check that was working
by luck with older kernels (becasue we could set in and out at the same
time even without a disconnect event), and that all you care about is to
get the wakeup from the write or disconnect events. And in turn the new
linux 2.6.11-rc should not work by luck anymore.

Comments appreciated.

Thanks.
-------------- next part --------------
An embedded message was scrubbed...
From: Andrea Arcangeli <andrea at suse.de>
Subject: two pipe bugfixes
Date: Mon, 28 Feb 2005 05:25:44 +0100
Size: 5047
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20050228/fcc62a25/attachment.eml 
-------------- next part --------------
An embedded message was scrubbed...
From: Linus Torvalds <torvalds at osdl.org>
Subject: Re: two pipe bugfixes
Date: Mon, 28 Feb 2005 08:25:07 -0800 (PST)
Size: 4241
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20050228/fcc62a25/attachment-0001.eml 
-------------- next part --------------
An embedded message was scrubbed...
From: Andrea Arcangeli <andrea at suse.de>
Subject: Re: two pipe bugfixes
Date: Mon, 28 Feb 2005 20:04:37 +0100
Size: 2997
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20050228/fcc62a25/attachment-0002.eml 
-------------- next part --------------
An embedded message was scrubbed...
From: Linus Torvalds <torvalds at osdl.org>
Subject: Re: two pipe bugfixes
Date: Mon, 28 Feb 2005 11:22:18 -0800 (PST)
Size: 4526
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20050228/fcc62a25/attachment-0003.eml 
-------------- next part --------------
An embedded message was scrubbed...
From: Andrea Arcangeli <andrea at suse.de>
Subject: Re: two pipe bugfixes
Date: Mon, 28 Feb 2005 20:55:56 +0100
Size: 3825
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20050228/fcc62a25/attachment-0004.eml 


More information about the Twisted-Python mailing list