Skip to content
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

asyncio http call times out #3625

Closed
rickcoup opened this issue Feb 26, 2019 · 6 comments
Closed

asyncio http call times out #3625

rickcoup opened this issue Feb 26, 2019 · 6 comments
Labels
bug needs-info Issue is lacking sufficient information and will be closed if not provided Stale

Comments

@rickcoup
Copy link

Long story short

We are making async call to the a site. It times out on it. With the network sniffer, it shows the site responses within 400ms.

Expected behaviour

Get the response back.

Actual behaviour

Throwing the error:

File "/opt/app-root/src/pppLib.py", line 407, in fetch\n async with session.post(url, data=pData, headers=head, timeout=timeout) as response:\n File "/opt/app-root/lib/python3.6/site-packages/aiohttp/client.py", line 1005, in aenter\n self._resp = await self._coro\n File "/opt/app-root/lib/python3.6/site-packages/aiohttp/client.py", line 575, in _request\n break\n File "/opt/app-root/lib/python3.6/site-packages/aiohttp/helpers.py", line 585, in exit\n raise asyncio.TimeoutError from None"}
 
I've checked the client.py code, haven't get much clue on it yet.

Steps to reproduce

The code is like this:

async def fetch(session, url):
    #async with session.get(url) as response:
    async with getattr(session,"get")(url) as response:
        return await response.text()

Your environment

redhat 3.9, python 3.6.3, aiohttp 3.5.4 and asyncio 3.4.3

@aio-libs-bot
Copy link

GitMate.io thinks the contributor most likely able to help you is @asvetlov.

Possibly related issues are #33 (HTTPS Support), #1745 (Call https website through proxy will cause error), #320 (HTTP/2 support), #858 (replace http parser?), and #6 (HTTP pipelining support improvements).

@rickcoup
Copy link
Author

The proxy is not an issue. We got response back in normal situation. It happens under heavy number of requests only.

@odysseusmax
Copy link

i too get this error

Traceback (most recent call last):
   File "/app/downloads.py", line 127, in down_File
     async for chunk in r.content.iter_chunked(1024*512):
   File "/app/.heroku/python/lib/python3.7/site-packages/aiohttp/streams.py", line 40, in __anext__
     rv = await self.read_func()
   File "/app/.heroku/python/lib/python3.7/site-packages/aiohttp/streams.py", line 369, in read
    await self._wait('read')
   File "/app/.heroku/python/lib/python3.7/site-packages/aiohttp/streams.py", line 297, in _wait
     await waiter
   File "/app/.heroku/python/lib/python3.7/site-packages/aiohttp/helpers.py", line 585, in __exit__
     raise asyncio.TimeoutError from None
 concurrent.futures._base.TimeoutError

@KolbyML
Copy link

KolbyML commented Apr 9, 2019

so what should you limit the requests to be if its "heavy requests"

@KolbyML
Copy link

KolbyML commented Apr 9, 2019

ya as this issue only affects one object in my scheduler with the proxy i use but not others so 🤔

@Dreamsorcerer
Copy link
Member

There's not enough information here to provide any help. It could be that you've set the timeout too low or created too many tasks. The total timeout includes the time it takes to handle everything, not just the network request itself.

@Dreamsorcerer Dreamsorcerer added the needs-info Issue is lacking sufficient information and will be closed if not provided label Aug 11, 2024
@github-actions github-actions bot added the Stale label Sep 11, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-info Issue is lacking sufficient information and will be closed if not provided Stale
Projects
None yet
Development

No branches or pull requests

5 participants