From 85345d79c7dfc8f4cc6dba6f00126d371cc09d31 Mon Sep 17 00:00:00 2001 From: Petr Šabata Date: Jan 30 2017 00:41:39 +0000 Subject: Retry stalled downloads after 15 minutes, with the maximum of 5 retries This changes the current behavior which allows stalled downloads block indefinitely. 15 minutes (or 75, respectively) should provide more than enough time to download any single file hosted in our infrastructure. Signed-off-by: Petr Šabata --- diff --git a/bin/fedpkg-base b/bin/fedpkg-base index 1e4ca3c..87d90e8 100755 --- a/bin/fedpkg-base +++ b/bin/fedpkg-base @@ -33,13 +33,13 @@ if [[ -s sources ]]; then # Remove parenthesis around tarball name filename=${filename#(} tarball=${filename%)} - curl -L -H Pragma: -o "./$tarball" -R -S --fail "$baseurl/$pkgname/$tarball/$hashtype/$hash/$tarball" + curl -L -H Pragma: -o "./$tarball" -R -S --fail --retry 5 --max-time 15 "$baseurl/$pkgname/$tarball/$hashtype/$hash/$tarball" done < sources "${hashtype}sum" -c sources else # Ok, we're working with MD5. while read -r md5sum tarball; do - curl -L -H Pragma: -o "./$tarball" -R -S --fail "$baseurl/$pkgname/$tarball/$md5sum/$tarball" + curl -L -H Pragma: -o "./$tarball" -R -S --fail --retry 5 --max-time 15 "$baseurl/$pkgname/$tarball/$md5sum/$tarball" done < sources md5sum -c sources fi diff --git a/tests/test_md5_bsd/expected b/tests/test_md5_bsd/expected index 399b56f..792d67f 100644 --- a/tests/test_md5_bsd/expected +++ b/tests/test_md5_bsd/expected @@ -1,2 +1,2 @@ -curl -L -H Pragma: -o ./github-linguist-4.8.18.gem -R -S --fail https://src.fedoraproject.org/repo/pkgs/test_md5_bsd/github-linguist-4.8.18.gem/md5/192de5f33807d72e573c54f61892fc69/github-linguist-4.8.18.gem +curl -L -H Pragma: -o ./github-linguist-4.8.18.gem -R -S --fail --retry 5 --max-time 15 https://src.fedoraproject.org/repo/pkgs/test_md5_bsd/github-linguist-4.8.18.gem/md5/192de5f33807d72e573c54f61892fc69/github-linguist-4.8.18.gem md5sum -c sources diff --git a/tests/test_md5_old/expected b/tests/test_md5_old/expected index 51894c0..5ab54d1 100644 --- a/tests/test_md5_old/expected +++ b/tests/test_md5_old/expected @@ -1,2 +1,2 @@ -curl -L -H Pragma: -o ./entr-3.6.tar.gz -R -S --fail https://src.fedoraproject.org/repo/pkgs/test_md5_old/entr-3.6.tar.gz/072eed7153296a8fae6ebdedefed9fd4/entr-3.6.tar.gz +curl -L -H Pragma: -o ./entr-3.6.tar.gz -R -S --fail --retry 5 --max-time 15 https://src.fedoraproject.org/repo/pkgs/test_md5_old/entr-3.6.tar.gz/072eed7153296a8fae6ebdedefed9fd4/entr-3.6.tar.gz md5sum -c sources diff --git a/tests/test_sha512_bsd/expected b/tests/test_sha512_bsd/expected index 1bf663e..fbbf4f6 100644 --- a/tests/test_sha512_bsd/expected +++ b/tests/test_sha512_bsd/expected @@ -1,2 +1,2 @@ -curl -L -H Pragma: -o ./github-linguist-4.8.18.gem -R -S --fail https://src.fedoraproject.org/repo/pkgs/test_sha512_bsd/github-linguist-4.8.18.gem/sha512/d556ffe0062bc2c745c46e94929eab18c79fd221ffc1dd0c0ea5868428bd130d7b15eec618e9c3940b50c27559923911135770792864f3330a606132dc8819c0/github-linguist-4.8.18.gem +curl -L -H Pragma: -o ./github-linguist-4.8.18.gem -R -S --fail --retry 5 --max-time 15 https://src.fedoraproject.org/repo/pkgs/test_sha512_bsd/github-linguist-4.8.18.gem/sha512/d556ffe0062bc2c745c46e94929eab18c79fd221ffc1dd0c0ea5868428bd130d7b15eec618e9c3940b50c27559923911135770792864f3330a606132dc8819c0/github-linguist-4.8.18.gem sha512sum -c sources