Skip to content
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

app.py: Work around incompatibility between Tornado 6 and asyncio proactor event loop in python 3.8 on Windows #3123

Merged
merged 3 commits into from
Aug 10, 2020

Conversation

alexweav
Copy link
Contributor

@alexweav alexweav commented Jul 22, 2020

In py38, asyncio made the WindowsProactorEventLoopPolicy the default setting for event loops on Windows. However, this is incompatible with Tornado. The result is that the Hub does not start on Windows on Python 3.8, with a NotImplementedError. See tornadoweb/tornado#2608 for additional context.

The workaround suggested by Tornado is to use the older WindowsSelectorEventLoopPolicy, which is the default in py37 and before. This is done via:

asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

This workaround has already been applied in the single-user server: jupyter/notebook#5047. The content of this PR is almost identical to the single-user one, save for some formatting differences. We only alter the default setting if we're running in an environment where this issue might occur (Windows, py38, and a sufficiently advanced asyncio API).

@welcome
Copy link

welcome bot commented Jul 22, 2020

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@alexweav
Copy link
Contributor Author

Hello @minrk, sorry to bother, but is there a chance you or someone else might be able to review this PR? (I pinged you because the content of this PR was originally authored by you, but in the single-user server instead)

@minrk minrk merged commit e2ee18f into jupyterhub:master Aug 10, 2020
@welcome
Copy link

welcome bot commented Aug 10, 2020

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

@minrk
Copy link
Member

minrk commented Aug 10, 2020

Thanks for the PR! Just getting back from vacation today.

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

Successfully merging this pull request may close these issues.

3 participants