From 38ab9dedf484469792e1cad557f3f69a73e3b853 Mon Sep 17 00:00:00 2001 From: Maggie Spletzer Date: Tue, 18 Apr 2023 14:31:46 -0400 Subject: [PATCH] Adding curl retry for external tool downloads (#2552) * adding retry for flaky downloads * adding comment * Update src/Misc/externals.sh Co-authored-by: Tingluo Huang --------- Co-authored-by: Tingluo Huang --- src/Misc/externals.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Misc/externals.sh b/src/Misc/externals.sh index f9c9c95df..4a1254f33 100755 --- a/src/Misc/externals.sh +++ b/src/Misc/externals.sh @@ -60,7 +60,8 @@ function acquireExternalTool() { # -S Show error. With -s, make curl show errors when they occur # -L Follow redirects (H) # -o FILE Write to FILE instead of stdout - curl -fkSL -o "$partial_target" "$download_source" 2>"${download_target}_download.log" || checkRC 'curl' + # --retry 3 Retries transient errors 3 times (timeouts, 5xx) + curl -fkSL --retry 3 -o "$partial_target" "$download_source" 2>"${download_target}_download.log" || checkRC 'curl' # Move the partial file to the download target. mv "$partial_target" "$download_target" || checkRC 'mv'