This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients giampaolo.rodola, neologix, python-dev, sbt
Date 2013-09-06.06:57:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM3dEZ9YhrFWmojW2L=xMp5Gq1OHZZDk_Bd_g5MEbrcdHA@mail.gmail.com>
In-reply-to <1378418939.36.0.644825845371.issue18934@psf.upfronthosting.co.za>
Content
> Richard Oudkerk added the comment:
>
> I remember wondering at one time why EPOLLNVAL did not exist, and realizing that closed fds are just silently unregistered by epoll().

Exactly.

> I guess the issue is that some of the selectors indicate a bad fd on registration, and others do it when polled.
>
>                 On registration      On poll
> ----------------------------------------------------------------
> SelectSelector  No                   Raises OSError
> PollSelector    No                   No (EVENT_READ or EVENT_WRITE)
> EpollSelector   Raises OSError       No
> KqueueSelector  ?                    ?

Kqueue raises OSError upon registration. Not sure about poll().

> It would be easiest to relax the test, perhaps by just checking that conn.poll(0) raises or returns True.

That's what I think too. Apparently, the test was added for this
issue: http://bugs.python.org/issue3321

Basically, the goal was to check that conn.poll() wouldn't crash if
passed an invalid FD (which can happen if you register a FD greater
than FD_SETSIZE in a fd_set).
So relaxing the check would still make sense.

> Or maybe PollSelector.select() should raise OSError if POLLNVAL is indicated.  That would match the behaviour of SelectSelector.select().

Yes, that would be a possibility. I'll have to give it some more thought.
History
Date User Action Args
2013-09-06 06:57:40neologixsetrecipients: + neologix, giampaolo.rodola, python-dev, sbt
2013-09-06 06:57:40neologixlinkissue18934 messages
2013-09-06 06:57:39neologixcreate