Open Kludex opened 12 months ago
I can't reproduce on the latest versions of the packages, and considering Python 3.9 and 3.10.
If you can create a repository, and show me in the CI how this fails, I can continue helping.
@Kludex I created a repo here that reproduces the issue in this action run.
The issue does not always occur on the first request, so I added a loop that sends multiple requests in a row.
I can reproduce your MRE using uvicorn
running with the AsyncIO event loop on Python 3.9. I cannot reproduce with the latest Python version, and I also can't reproduce with uvloop
.
I'm having the same issue with Python 3.11.9 and starlette==0.38.6
(transient dep from the FastAPI==0.115.0
).
In my case, I'm doing simple JSON POST, but I only notice it on "high enough" loads.
Installing the uvloop
fixes the issue indeed...
I can confirm this bug.
I have to work with some older versions due to some dependencies.
With starlette== 0.23.1
and fastapi==0.90.1
and python 3.11 I can reproduce the error.
Can also confirm that uvloop fixed it. Simply installing it in the venv did the trick, funnily enough.
I didnt even have to change any code.
Discussed in https://github.com/encode/starlette/discussions/2312