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

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

Open
TristanCacqueray opened this issue Feb 7, 2025 · 0 comments

Comments

@TristanCacqueray
Copy link

TristanCacqueray commented Feb 7, 2025

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 httpLbs manager =<< 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 seconds, 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 is our downstream bug with the details: change-metrics/monocle#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant