Open
Description
Looking at twisted/twisted#996 led me to investigate more the difference between EMFILE
and WSAEMFILE
... the latter is the special "winsockets" version of EMFILE
, and apparently they are actually different:
In [2]: errno.EMFILE
Out[2]: 24
In [3]: errno.WSAEMFILE
Out[3]: 10024
And right now serve_listeners
has special handling for EMFILE
, but not WSAEMFILE
... so it's probably broken.
We should:
- Add the WSA variants to the list of errnos here:
trio/trio/_highlevel_serve_listeners.py
Lines 11 to 16 in 7b7b7d1
- Double-check if we need to modify the list in
SocketListener
:trio/trio/_highlevel_socket.py
Lines 291 to 311 in 7b7b7d1
- Modify our EMFILE test so that it actually provokes a real EMFILE, instead of a fake one like we do now:
trio/trio/tests/test_highlevel_serve_listeners.py
Lines 102 to 105 in 7b7b7d1