-
-
Notifications
You must be signed in to change notification settings - Fork 748
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
Slow reload on Windows 10 using PyCharm #2000
Comments
I think issue lies somewhere here: uvicorn/uvicorn/supervisors/basereload.py Lines 87 to 99 in 7d4eab2
With the changes introduced in #1584, it will hang for multiple minutes on the process.join() call. If I remove the changes, so the function looks like:
The reload is pretty much instant, like it was on earlier versions. |
Got it. Please open an issue on PyCharm's issue tracker. If they tell me it's a Uvicorn bug, and explain why, we can think about the next step. 👍 |
I've added a very small program that has the same issue and does not use Uvicorn. I do not think this is a Uvicorn bug, however if Jetbrains does not want to fix this, in my opinion it might still be worth it to investigate if we can support this in Uvicorn by not using btw, thank you for the quick responses :) |
Hello, I am getting a similar error on 0.22.0 but it happens both when I run with uvicorn.run or in the terminal, with --reload. |
The same problem right now on FastAPI and default pycharm run settings with --reload |
Is there someone having this issue without pycharm? |
No, this problem occurs when starting the server through pycharm tools, if you run the server with the same command through the terminal, --reload works instantly |
Thanks @altq33 :) I'm locking this issue since people keep spamming here. This is a pycharm issue: youtrack.jetbrains.com/issue/PY-60962/os.killpid-signal.CRTLCEVENT-ignored-when-running-python-program-from-Pycharm. If you have an issue with Windows (not using Pycharm), please create a new issue. (I'll not close this issue so people can be aware) |
I've unlocked the issue, so people can concentrate the complains here instead of creating multiple issues/discussions. |
@leonardomarcao The issue in Pycharm still persists and is tracked here: https://youtrack.jetbrains.com/issue/PY-60962/os.killpid-signal.CRTLCEVENT-ignored-when-running-python-program-from-Pycharm |
Still struggling same issue. |
Locking this issue again. This is a PyCharm issue, not Uvicorn. |
Discussed in #1977
Originally posted by adhihargo May 14, 2023
Uvicorn used to work fine in my dev laptop running Windows 10, but now every time there's a modified change, it stuck in this line:
WARNING: WatchFiles detected changes in 'main.py'. Reloading...
... for nearly 5 minutes before actually reloading the files (printing
Shutting down
in the next line, etc.). During that time, the API server part works normally but serving the older version before file modification..Downgraded to v0.21.1, and reloading works instantly again.
Important
The text was updated successfully, but these errors were encountered: