Open ulysses500 opened 1 year ago
You'll need to create a full reproducer, it seems incredibly unlikely that this is an issue with aiohttp, as it seems like it'd affect 1000s of users if that was really happening.
You are right. I have noticed that I have made a mistake in FastAPI, in the main function that calls aiohttp:
@app.get('/get_data/{random_ref}')
async def get_data(request: Request):
instead of:
@app.get('/get_data/{random_ref}')
async def get_data(request: Request,random_ref):
It could have mistaken the main request and not the one from aiohttp.
The problem still happens. Could be a problem from FastAPI.
Note: Not sure that many aiohttp users have long processes to deal with.
It still looks very unlikely to be an issue with aiohttp. I just can't imagine how 2 requests could resolve the same response, they have separate connections and are isolated objects. Unless you can reproduce this with an aiohttp server, I feel like this is an issue with FastAPI (or your code).
Describe the bug
I have a bug where two separate requests, a few seconds apart, consistently receive the response from the first request. Here is the client-side request:
And this is the custom server-side endpoint with FastAPI:
Unfortunatelly, the response is not specific to the request, even if there is a random number. It's worth noting that the response takes a long time due to a lengthy Deep Learning generation process (30 seconds to 1 minute), so it's not a latency or performance issue.
To Reproduce
Expected behavior
Every request should have its corresponding answer.
Logs/tracebacks
Python Version
aiohttp Version
multidict Version
yarl Version
OS
Windows 11
Related component
Server, Client
Additional context
Google App Engine
Code of Conduct