uvicorn signal handling issue after uvicorn >= 0.29 #2451
Unanswered
cquike
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an issue with the following code that starts and stops uvicorn programatically:
The idea is that the application is responsible of starting the uvicorn process as a child process and then stops it either before the parent process finishes or when it receives a signal. Before uvicorn 0.29 that worked fine. However from 0.29 onwards I get the following error:
I am not sure whether that is a bug or the intended behaviour. As I understand it the child process will inherit the signal handlers from the parent, so I don't know whether in uvicorn it is simply not possible to have a process that has already its own signal handling,
I was able to workaround the issue by registering the signals after the uvicorn process starts:
However there is a (albeit small) potential race condition if a signal is delivered after the uvicorn process starts and before the signals are registered.
So is this a bug in uvicorn or am I doing something wrong? There is a similar discussion already #2368 but I am not sure it is about the same thing.
Beta Was this translation helpful? Give feedback.
All reactions