You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by as...@apache.org on 2023/11/18 03:11:45 UTC
(arrow) branch main updated: GH-38766: [R] Add timeout option to try_download (#38767)
This is an automated email from the ASF dual-hosted git repository.
assignuser pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new c6682f11fa GH-38766: [R] Add timeout option to try_download (#38767)
c6682f11fa is described below
commit c6682f11fa7b66e146fa999f79eae457f23f6628
Author: Dewey Dunnington <de...@fishandwhistle.net>
AuthorDate: Fri Nov 17 23:11:39 2023 -0400
GH-38766: [R] Add timeout option to try_download (#38767)
### Rationale for this change
The download of static libraries during installation might be causing an install failure: https://www.r-project.org/nosvn/R.check/r-devel-windows-x86_64/arrow-00install.html
### What changes are included in this PR?
The timeout value is temporarily increased according to guidance in the help for `download.file()`
### Are these changes tested?
Yes, this code runs during install for at least some CI jobs (also used to download cmake)
### Are there any user-facing changes?
No
* Closes: #38766
Lead-authored-by: Dewey Dunnington <de...@fishandwhistle.net>
Co-authored-by: Dewey Dunnington <de...@voltrondata.com>
Signed-off-by: Jacob Wujciak-Jens <ja...@wujciak.de>
---
r/tools/nixlibs.R | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R
index 436eefcfcf..03cbfbc5e9 100644
--- a/r/tools/nixlibs.R
+++ b/r/tools/nixlibs.R
@@ -79,9 +79,15 @@ find_latest_nightly <- function(description_version,
}
try_download <- function(from_url, to_file, hush = quietly) {
+ # We download some fairly large files, so ensure the timeout is set appropriately.
+ # This assumes a static library size of 100 MB (generous) and a download speed
+ # of 1 MB/s (slow).
+ opts <- options(timeout = max(100, getOption("timeout")))
+ on.exit(options(opts))
+
status <- try(
suppressWarnings(
- download.file(from_url, to_file, quiet = hush)
+ download.file(from_url, to_file, quiet = hush, mode = "wb")
),
silent = hush
)