[issue19017] selectors: towards uniform EBADF handling

Charles-François Natali report at bugs.python.org
Mon Sep 16 20:41:52 CEST 2013


Charles-François Natali added the comment:

> Interesting issue.  ISTM that closing the FD before unregistering it is a programmer's mistake that shouldn't pass silently.  And closing it in a separate thread while the selector is active sounds like an even bigger bug.

Agreed.

> Could we report an new event type for this situation?  E.g. EVENT_CLOSED.  The proper response would be to unregister the FD.  (And yes, unregistering the FD when it was previously registered should not be an error, even if it has been closed.)

The problem is that for epoll (and kqueue I think) the FD is
automagically removed from the backend, which means that we won't get
any notification for this FD, hence we're unable to report it as
closed.

----------

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


More information about the Python-bugs-list mailing list