[issue19017] selectors: towards uniform EBADF handling

STINNER Victor report at bugs.python.org
Wed Feb 4 17:48:35 CET 2015


STINNER Victor added the comment:

Guido wrote:
"This still leaves case (1), where the FD is already bad when we register it.  I am actually fine with sometimes raising and sometimes not; I don't want to pay the extra overhead of doing an fstat() or some other syscall just to verify that it is valid.  (Although this would make the argument about wanting to choose a selector class that doesn't make extra syscalls less compelling. :-)  And neither do I want to ignore the error in register() and pretend success."

The asyncio has a debug mode which can execute expensive checks. These checks would not be acceptable in release mode since they are an impact on performances. In debug mode, asyncio can explicitly call fstat() before calling selector.register() or selector.modify().

This solution may be suggested in the documentation if someone wants a portable behaviour for all selector.

----------

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


More information about the Python-bugs-list mailing list