From d6109aaa64199fef7164608743e43a400034e502 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Mon, 12 Oct 2026 14:07:58 +0200 Subject: [PATCH] curl_download: wait between attempts The three attempts ran back to back, so a release CDN answering 504 for a few seconds failed all of them within a second and aborted the install, although the asset was there. Wait 10 s, then 20 s. --- lib/system.func | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/system.func b/lib/system.func index 96d8251..5f3d314 100644 --- a/lib/system.func +++ b/lib/system.func @@ -2206,9 +2206,11 @@ ensure_usr_local_bin_persist() { # for 60 consecutive seconds (i.e. a genuine stall or dead connection). # Retries up to 3 times on failure, continuing where the last attempt stopped: # starting a 1.5 GB archive over on every stall is how large downloads kept -# failing. The last attempt goes over IPv4, since a broken IPv6 path is a -# common cause of stalls. The file is written to .part and moved into -# place only when complete, so a failure leaves an existing intact. +# failing. Attempts are 10 s and 20 s apart: back to back, a CDN answering 504 +# for a few seconds used up all three. The last attempt goes over IPv4, since a +# broken IPv6 path is a common cause of stalls. The file is written to +# .part and moved into place only when complete, so a failure leaves an +# existing intact. # Returns 0 on success, 7 if all attempts fail. # ------------------------------------------------------------------------------ curl_download() { @@ -2239,7 +2241,8 @@ curl_download() { # 33: the server cannot resume, so the next attempt starts over. ((rc == 33)) && rm -f "$part" if ((attempt < retries)); then - msg_warn "Download failed or stalled (attempt ${attempt}/${retries}), retrying..." + msg_warn "Download failed or stalled (attempt ${attempt}/${retries}), retrying in $((attempt * 10))s..." + sleep $((attempt * 10)) fi ((attempt++)) done