-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ProcessPoolExecutor in background cause freeze after keep-alive timeout #1883
Comments
I do not think this is aiohttp problem. here is what is going on:
to confirm, you can make |
try aiohttp.client |
This works with curl cause it closes connections. Same bug can be reproduced with Chrome and Firefox cause they use keep-alive. We can set small keep-alive timeout for easier bug reproducing. |
Yes. We can reproduce it using |
I see. It seems related how tcp works in general. |
fix in #1884 |
It works in Chrome, Firefox, requests but not in aiohttp.client |
this seems bug in asyncio default event loop. works with uvloop. @1st1 ^^^ |
async-tokio loop does not work as well. seems special treatment is needed for HUP event |
would be great if someone could submit a bug report on bugs.python.org. |
will do, but I want to play with implementation first |
@fafhrd91 could you provide more details? |
If I rember right, this is problem of the default event loop, it does not react on socket hup event after timeout or something like that. So aiohttp can not close socket until it tries to write to it something. But uvloop works right. This is reproducible. |
The issue is stale. |
Long story short
If we run heavy task in
ProcessPoolExecutor
in background,aiohttp
don't handle request after some timeout. It happens after ~75 seconds. It's equalkeepalive_timeout
value at https://github.com/aio-libs/aiohttp/blob/2.0.7/aiohttp/web_protocol.py#L82If we change
keepalive_timeout
value we get freeze after specific time.Expected behaviour
Handle all requests.
Actual behaviour
Freeze on request after keep-alive timeout.
Steps to reproduce
We set keep-alive timeout to 1 second for faster bug reproducing.
/start
request. Wait for keep-alive timeout. Make second/stop
request.aiohttp
will not handle second/stop
request.Your environment
Debian 8 Jessie
Python 3.5.3
aiohttp == 2.0.7
The text was updated successfully, but these errors were encountered: