Uvicorn >= 0.29.0 doesn't terminate if other threads have been started #2547
Replies: 1 comment 1 reply
-
This was an intentional change to allow programs to react to SIGINT. Your program could be easily fixed if But frankly I am getting more and more the impression that a true programmatic usage is not desired, but rather that people expect every single entry point to behave like the broken CLI that uvicorn was before. So instead of discussing this endlessly and calling things „bug" that frankly most don’t understand: |
Beta Was this translation helpful? Give feedback.
-
I tried to update to the latest version of uvicorn, coming from a version < 0.29.0, and now my app doesn't close on SIGINT anymore. I found the issue #2289 which has supposedly been fixed in 0.30.0 and is thus closed, but just like the latest commenter I have issues also in the latest version.
Here is a small example:
When using uvicorn < 0.29.0 it doesn't matter whether
ADD_SIGNAL_HANDLER
is True or False. I always get the same behaviour that theserver.run()
ends fine, and my own thread also ends.On uvicorn >= 0.29.0, however, when
ADD_SIGNAL_HANDLER
is True everything works just like on the earlier versions, but when it is False the output is instead:After this it hangs, and I have to do another Ctrl+C to be able to exit.
I would argue this is still a bug that needs to be fixed.
Beta Was this translation helpful? Give feedback.
All reactions