ITADN

Setting the managerResponseTimeout in the http-client-openssl is ignored

#552OpenTristanCacqueray 创建于 2025-02-07
Hello, It looks like that setting the response timeout in the openssl manager does not work as expected. We tried to increase the default timeout to 60 seconds, and we observed that when a server provides the response header, but not the data, then the client gets stuck waiting forever. We reproduced the issue using netcat that way: - Run `nc -l -p 80` in another terminal - Call `httpRequest =<< parseUrlThrow "http://localhost" ` in ghci - Submit fake response in nc like this: ``` [tristanc@fedora ~]$ nc -l -p 80 GET / HTTP/1.1 Host: localhost Accept-Encoding: gzip HTTP/1.1 404 Not Found Content-Type: text/html; charset=UTF-8 Referrer-Policy: no-referrer Content-Length: 1561 Date: Fri, 07 Feb 2025 14:12:02 GMT ``` When using the default openssl manager, then the httpRequest throws a timeout error after 30 second, as expected. But when using `{managerResponseTimeout = responseTimeoutMicro 60000000}`, then the httpRequest call gets stuck. This issue does not happen with the regular http-client manager. Thankfully, using System.Timeout.timeout work around the issue. Here our downstream bug with the details: https://github.com/change-metrics/monocle/issues/1154 Would you know what's going on and where to look for finding this bug in http-client? I couldn't find any reference for "timeout" in http-client-openssl or HsOpenSSL.
0 条评论