Skip to content

Timeouts greater than 10 s are ignored #395

Description

@Kodiologist

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 r-lib/httr#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions