Skip to content

Override default asyncio event loop with reload only - #1257

Merged
euri10 merged 4 commits into
Kludex:masterfrom
jammer87:selector-on-reload
Nov 24, 2021
Merged

Override default asyncio event loop with reload only#1257
euri10 merged 4 commits into
Kludex:masterfrom
jammer87:selector-on-reload

Conversation

@jammer87

Copy link
Copy Markdown
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
Comment thread uvicorn/loops/asyncio.py Outdated
Comment thread uvicorn/loops/auto.py Outdated
@jammer87
jammer87 requested a review from euri10 November 24, 2021 01:46

@euri10 euri10 left a comment

Copy link
Copy Markdown
Contributor

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 Kludex:master Nov 24, 2021
Kludex pushed a commit to sephioh/uvicorn that referenced this pull request Oct 29, 2022
…ex#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.

3 participants