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

Override default asyncio event loop with reload only #1257

Merged
merged 4 commits into from
Nov 24, 2021

Conversation

jammer87
Copy link
Contributor

#535 changed the default event loop in windows to the selector event loop to avoid an issue with the --reload flag (see #529).

This can cause the issue described in #1220 as well as make the asyncio.subprocess.create_subprocess_* calls fail.

This PR overrides the event loop only with reload configured on windows and logs a warning as suggested in this comment.

@Kludex Kludex requested a review from euri10 November 22, 2021 21:06
@Kludex Kludex added the windows label Nov 22, 2021
uvicorn/loops/asyncio.py Outdated Show resolved Hide resolved
uvicorn/loops/auto.py Outdated Show resolved Hide resolved
@jammer87 jammer87 requested a review from euri10 November 24, 2021 01:46
Copy link
Member

@euri10 euri10 left a comment

Choose a reason for hiding this comment

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

thnkas @jammer87

@euri10 euri10 merged commit 81802ce into encode:master Nov 24, 2021
Kludex pushed a commit to sephioh/uvicorn that referenced this pull request Oct 29, 2022
…de#1257)

* Override default asyncio loop with reload only

* shortened warning

* Added type hints for keyword arguments

* Changed to explicit reload keyword argument for loop setups
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.

None yet

3 participants