I was working on Flask microservice and I needed to rewrite it with FastAPI but I had a problem that I had not with Flask.
The problem is that I send a request which is not reaching the server indefinitely. To unstuck the request for example with Postman or Hoppscotch I cancel the request and I resend the same one and it works perfectly. I also tried with curl and I cannot reproduce the problem, the request works at the first time.
I am using uvicorn and I tried with other ASGI servers and I reproduce the problem with Hypercorn. However, I tried to reproduce it with Daphne and it works.
I have no error messages because the request is just stuck and the server never catch it.
I cannot provide a minimal reproducible example as I wasn't able to create one. In fact I initialized some FastAPI projects and none of them had this problem. The project where I have this bug has a lot of background code and using multiprocessing and threading, maybe that is the cause of the problem ?
I tried many things to understand what can cause the problem. Do you have any ideas of what can produce what I have described above ?