[Twisted-Python] kqueue reactor / ticket #1918

Glyph Lefkowitz glyph at twistedmatrix.com
Sun Nov 6 14:12:58 MST 2011


On Nov 5, 2011, at 1:46 PM, Tobias Oberstein wrote:

>>> Then, baseline. I've run the trial using select reactor in the
>>> expectation of finding all tests passed.
>>> 
>>> This is not the case, there are a couple of failed ones. Those are
>>> also failed with the kqueue reactor, so I need to know whether I need
>>> to inspect those or those are problems unrelated to the reactor, but of
>> general (platform?) nature.
>> 
>> Are you using Twisted 11? Many of these issues are, if I'm not mistaken,
>> fixed in trunk (though perhaps not all). So trunk is probably a better baseline
>> to work off of.
> 
> Ok, I'm using trunk now.
> 
> 1)
> The errors in
> 
> twisted.python.test.test_components
> 
> are gone.
> 
> 2)
> The errors in
> 
> twisted.internet.test.test_posixprocess
> twisted.internet.test.test_process
> 
> are still there ... and they show up for select, poll and kqueue reactors.
> 
> They all somehow relate to "open FDs":
> 
> twisted.internet.test.test_posixprocess
>  FileDescriptorTests
>    test_expectedFDs ...                                                 [FAIL]
> 
> twisted.internet.test.test_process
>  PTYProcessTestsBuilder_KQueueReactor
>    test_openFileDescriptors ...                                        [ERROR]
>  PTYProcessTestsBuilder_PollReactor
>    test_openFileDescriptors ...                                        [ERROR]
>  PTYProcessTestsBuilder_SelectReactor
>    test_openFileDescriptors ...                                        [ERROR]
> ProcessTestsBuilder_SelectReactor
>    test_openFileDescriptors ...                                        [ERROR]
> 
> This might more a FreeBSD related thing. ?

Yes.

These tests should pass; I am guessing this has something to do with the still-open ticket <http://tm.tl/4747>.  Maybe have a look at fixing that?

You might be able to work around it on your system this by mounting fdescfs at /dev/fd.  (This really ought to be the default, please bother someone in FreeBSD-land to make it so. :)).

It would be useful to include tracebacks with the errors.  "trial --rterrors" is useful, as it includes the tracebacks  especially if you are experiencing hanging with the tests.

> 3)
> I think I've nailed down the Half-Close stuff.

Awesome.  Do you have a link to a changeset for that?  (Did I miss it earlier in the thread?)

> 4)
> These are kqueue specific. Need to investigate further.

These are the ones to focus on for <http://tm.tl/1918>, then :).

> twisted.internet.test.test_fdset
>  ReactorFDSetTestsBuilder_KQueueReactor
>    test_lostFileDescriptor ...                                         [ERROR]
>    test_removedFromReactor ...                                          [FAIL]
> 
> The first one comes up, since
> 
> removeReader()
> 
> is called for a FD which is gone,  and leads to a socket exception from fd = reader.fileno()

It sounds like you've narrowed this down pretty far!  Good work.

> 5)
> These are kqueue specific. Need to investigate further.
> 
> twisted.conch.test.test_conch
> 
> The fail on the kqeue control call .. see below.
> 
> Any ideas what could be the reason?

I would suggest fixing the issues you outlined in point 4 first.  It's really unfortunate that reactor issues are being caught by conch tests.  The reactor tests should be comprehensive enough to catch everything in the reactor.

This may just be a side-effect of the other errors you're tracking down, so see if you can fix those, and then loop back to these.  If they disappear, then great.  If not, then we should have a test that specifically tests this functionality and doesn't rely on weird and difficult to diagnose errors in conch to find them.

Thanks again for working on this!

-glyph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20111106/e79ac761/attachment.html>


More information about the Twisted-Python mailing list