-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Aiohttp.web server timeout on long requests. #1541
Comments
just tried this test #!/usr/bin/env python3
import asyncio
from aiohttp.web import Application, Response, HTTPOk, run_app
async def intro(request):
idx = 0
while True:
await asyncio.sleep(1.0)
idx += 1
print('Secs: %s' % idx)
return HTTPOk()
async def init(loop):
app = Application()
app.router.add_get('/', intro)
return app
loop = asyncio.get_event_loop()
app = loop.run_until_complete(init(loop))
run_app(app) with do you use nginx or other proxy in front of aiohttp server? |
btw as i remember elb has 60 sec timeout |
Thank you for the fast response. With more testing it does appear to be external to aiohttp. The difference is timing out cancels the task in aiohttp vs it would keep running on our old tornado however I think that is a desirable thing. Going to close unless I hit something else. Thanks |
Long story short
Something in aiohttp or asyncio is timing out our web requests that take longer than 60 seconds to complete. We expect long requests and want to configure our server to not timeout on these. I am pretty confident its something inside the aiohttp server as this did not happen when the server was a tornado server before we re-wrote it to aiohttp. Requests end in different places and the following ends up in our logs
We are running the aiohttp server via web.Application such as
It does not appear from the docs that there are any timeout options. I do see some in the lower level server but web.run_app seems to prevent one from setting these.
Expected behaviour
Ability to set desired timeout behavior while configuring the application or during run_app
Actual behaviour
Web requests time out with a cancelled error at 60s
Steps to reproduce
Make a handler with work greater than 60s. Launch application via web.run_app. Invoke handler route and verify work was cancelled after 60s.
Your environment
python 3.5.2. Deployed via Docker on AWS ECS.
The text was updated successfully, but these errors were encountered: