You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I do timeout 1000000 (httpLbs req httpman) and have bad dns settings, the request can take much longer than those 1000000 microseconds (1s), and in fact only fails when the local dns times out (which on my system is 20 seconds)
timeout just sends the async exception. That should always work. It looks like the code that receives the exception blocks it. We should find out which code that is, in http-client or some underlying function that it uses.
throwIO, called at ./Network/HTTP/Client/Core.hs:214:29 in http-client-0.7.18-8b51d1b15e5c25165b3bb85934d446140d1bbf69417f7f85bf9c607f9642027b:Network.HTTP.Client.Core
When I do
timeout 1000000 (httpLbs req httpman)
and have bad dns settings, the request can take much longer than those 1000000 microseconds (1s), and in fact only fails when the local dns times out (which on my system is 20 seconds)(I thought this was just an inherent issue in timeout, but nh2 at https://old.reddit.com/r/haskell/comments/1ierl0f/myth_and_truth_in_haskell_asynchronous_exceptions/ indicated it might actually be a bug in the network library, so reporting here in case it actually is unexpected.)
To reproduce
(also tested on 9.2.8)
With working DNS this does the expected thing:
Now change DNS to a fake IP, so that DNS requests will hang (until the local resolver times out):
So that took 20s to time out where I asked for 1s.
strace of the above: https://termbin.com/n2y2
Now I re-enable working DNS and try again:
And if I shorten the timeout even more, still with working dns, it times out the expected way:
The text was updated successfully, but these errors were encountered: