Hot reloading improperly handles warnings
#2230
Unanswered
thearchitector
asked this question in
Potential Issue
Replies: 1 comment
-
im not sure if its directly related, but in a similar vein at least, an application with an on-load exception produces an unclosed socket error
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've observed a weird quirk where enabling hot reloading on an application that also makes uses of
warnings
triggers aResourceWarning
.Here's a simple example, using FastAPI as the underlying ASGI app:
If I bind a lifespan to the app and explicitly close
stdin
, the error goes away:It seems reasonable to me to ensure uvicorn properly closes the built-in file handles before reloading the app, as well as any other io it opens itself.
Beta Was this translation helpful? Give feedback.
All reactions