Skip to content

Add support for a server timeout on Windows for the mypy daemon #5962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
emmatyping opened this issue Nov 27, 2018 · 1 comment
Closed

Add support for a server timeout on Windows for the mypy daemon #5962

emmatyping opened this issue Nov 27, 2018 · 1 comment

Comments

@emmatyping
Copy link
Member

Due to limitations of the synchronous API of NamedPipes, the server will wait forever when waiting on a client connection. We should move to overlapped I/O, so the server can support timeouts, though it will likely bit a bit painful to change this.

@msullivan
Copy link
Collaborator

https://memset.wordpress.com/2010/10/08/timeout-on-named-pipes/ has some example code for doing it.

_winapi looks like it has decent support for using overlapped IO (and does some extra stuff to help out that I think would make it simpler than that example code).

The typeshed stubs don't seem to include that support, though, so those should get updated too.

emmatyping added a commit that referenced this issue Jan 8, 2019
This PR does a few things:

- Changes reads/writes/connects to use overlapped I/O on Windows
- Removes the need for special casing b'' as an EOF signal
- Adds support for timing out on connects for the server process (which means dmypy's --timeout flag works on Windows).
- Make the default timeout infinite (though this doesn't change anything functionally since we always specify alternatives in our usage)

Fixes #5962
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants