I get no response when using curl_httpclient in Tornado, the app hangs pending, what am I missing?

93 Views Asked by At

os: Debian 11 - minimal install, (SSH Server and Standard system utilities)

curl -V curl 7.74.0 (x86_64-pc-linux-gnu) libcurl/7.74.0 OpenSSL/1.1.1n zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.43.0 librtmp/2.3 Release-Date: 2020-12-09 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp Features: alt-svc AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

Used: Python 3.9.9, Python 3.11.2, Tornado 5.0.2, Tornado 6.2 - in various combinations.

Example: Queue example - a concurrent web spider - is taken from the Tornado documentation: https://www.tornadoweb.org/en/stable/guide/queues.html

When using curl_httpclient: AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient") the application hangs forever waiting.

I managed to trace the work of the program to the call to pycurl.CurlMulti() in the _process_queue() method, i.e. this suggests that the problem is not in Tornado, but somewhere at the pycurl level or rather related to libcurl.

I also tried to run cURL along with pycurl in simple tests, such as pycurl.Curl().perform() - I did not see any obvious problems.

Also, I included logging.DEBUG in the curl_httpclient module: curl.setopt(pycurl.VERBOSE, 1) curl.setopt(pycurl.DEBUGFUNCTION, self._curl_debug) but, apparently, the execution of the program does not reach the request, so no logs get into the output.

Due to the fact that I do not have an error text received, where can I see the logs at the pycurl-libcurl level? What test suite for pycurl do I need to implement to find the problem? All in all, I ask for advice, what steps do need to follow in my case?

Thank!

0

There are 0 best solutions below