python-trio / python-trio/trio

Better validate serve_listeners handling of weird edge cases

Open
#492 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

polish todo soon Windows
Dominant language
Python
Stars
7.3k
Forks
431
Avg merge
2d 17h
Merged PRs (30d)
6

Description

Looking at https://github.com/twisted/twisted/pull/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:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the errno handling in trio/_highlevel_serve_listeners.py and compare it with SocketListener in trio/_highlevel_socket.py. Review test_highlevel_serve_listeners.py around the EMFILE test, then verify that the relevant Windows errno variants and a real EMFILE condition are covered by the tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.