Skip to content

Add an optional timeout to dmypy_server #4700

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

Merged
merged 2 commits into from
Mar 9, 2018
Merged

Add an optional timeout to dmypy_server #4700

merged 2 commits into from
Mar 9, 2018

Conversation

msullivan
Copy link
Collaborator

@msullivan msullivan commented Mar 7, 2018

This allows it to shut down after a period of inactivity to avoid
hogging memory.

Also don't crash the server on an error communicating with the client.

@msullivan msullivan requested review from JukkaL and gvanrossum March 7, 2018 23:55
@@ -159,12 +168,15 @@ def serve(self) -> None:
if command == 'stop':
sock.close()
sys.exit(0)
except socket.timeout:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this try/except should only wrap the accept() call?

This allows it ot shut down after a period of inactivity to avoid
hogging memory.

Also don't crash the server on an error communicating with the client.
@msullivan msullivan changed the base branch from dmypy-fg-testing to master March 8, 2018 18:13
@msullivan msullivan merged commit 049925c into master Mar 9, 2018
@msullivan msullivan deleted the server_timeout branch March 9, 2018 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants