httr icon indicating copy to clipboard operation
httr copied to clipboard

Timeouts greater than 10 s are ignored

Open Kodiologist opened this issue 3 years ago • 1 comments

With httr 1.4.2:

> httr::GET("https://e4ftl01.cr.usgs.gov/MOTA/MCD19A2.006/2005.01.01", httr::timeout(1))
Error in curl::curl_fetch_memory(url, handle = handle) :
  Timeout was reached: [e4ftl01.cr.usgs.gov] Operation timed out after 1001 milliseconds with 0 out of 0 bytes received
> httr::GET("https://e4ftl01.cr.usgs.gov/MOTA/MCD19A2.006/2005.01.01", httr::timeout(9))

Error in curl::curl_fetch_memory(url, handle = handle) :
  Timeout was reached: [e4ftl01.cr.usgs.gov] Operation timed out after 9000 milliseconds with 0 out of 0 bytes received
> httr::GET("https://e4ftl01.cr.usgs.gov/MOTA/MCD19A2.006/2005.01.01", httr::timeout(10))

Error in curl::curl_fetch_memory(url, handle = handle) :
  Timeout was reached: [e4ftl01.cr.usgs.gov] Operation timed out after 10001 milliseconds with 0 out of 0 bytes received
> httr::GET("https://e4ftl01.cr.usgs.gov/MOTA/MCD19A2.006/2005.01.01", httr::timeout(11))

Error in curl::curl_fetch_memory(url, handle = handle) :
  Timeout was reached: [e4ftl01.cr.usgs.gov] Operation timed out after 10001 milliseconds with 0 out of 0 bytes received
> httr::GET("https://e4ftl01.cr.usgs.gov/MOTA/MCD19A2.006/2005.01.01", httr::timeout(12))

Error in curl::curl_fetch_memory(url, handle = handle) :
  Timeout was reached: [e4ftl01.cr.usgs.gov] Operation timed out after 10001 milliseconds with 0 out of 0 bytes received

I believe this is a duplicate of #501. Unfortunately, my example is only reproducible so long as this website is so slow.

I think the cause is upstream, where a 10-s timeout is hard-coded: https://github.com/jeroen/curl/blob/395fbcbc13ef7f38167d3837f50c3cad51902068/src/curl.c#L108

Kodiologist avatar Mar 29 '22 17:03 Kodiologist

I'm having the same problem. There is any workaround to this?

javieriserte avatar Sep 09 '22 08:09 javieriserte