tornadoweb / tornadoweb/tornado
CurlAsyncHTTPClient hangs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 22.2k
- Forks
- 5.6k
- Avg merge
- 3h 42m
- Merged PRs (30d)
- 16
Description
It hangs when executing method fetch with CurlAsyncHTTPClient. I tried working on CentOS, Python 3.7 ~ 3.9, but the behavior was the same.
However, when i use SimpleAsyncHTTPClient, it works fine.
Software environment:
- OS: Ubuntu 20.04.4 LTS
- Python: 3.8.13 (miniconda)
- tornado: 6.2
- pycurl: 7.45.1
- curl:
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
Here is my test code:
import asyncio
from tornado.httpclient import AsyncHTTPClient
AsyncHTTPClient.configure('tornado.curl_httpclient.CurlAsyncHTTPClient', max_clients=10)
http_client = AsyncHTTPClient()
async def main():
print('fetch...')
res = await http_client.fetch('http://localhost')
print('res', len(res.body))
asyncio.run(main())
I wonder if my code is wrong, since no one mentioned the same issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the hang with the asyncio script in the issue, then compare its CurlAsyncHTTPClient path with SimpleAsyncHTTPClient. Trace the fetch call through CurlAsyncHTTPClient and pycurl using the listed environment details. Done means identifying the cause of the hang, correcting it, and covering the behavior with a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100