Skip to content

Commit

Permalink
travis: Fix kernel download retry.
Browse files Browse the repository at this point in the history
wget stops retrying to download a file when hitting fatal http errors
like 503.
But if a previous try had resulted in a partially downloaded ${file}, the
next wget call tries to download to ${file}.1.

Example:
+wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.18.tar.xz
--2020-03-18 20:51:42--  https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.18.tar.xz
Resolving cdn.kernel.org (cdn.kernel.org)... 151.101.1.176, 151.101.65.176, 151.101.129.176, ...
Connecting to cdn.kernel.org (cdn.kernel.org)|151.101.1.176|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 103076276 (98M) [application/x-xz]
Saving to: ‘linux-4.16.18.tar.xz’

linux-4.16.18.tar.x   0%[                    ]  13.07K  --.-KB/s    in 0s

2020-03-18 20:54:44 (133 MB/s) - Read error at byte 13383/103076276 (Connection reset by peer). Retrying.

--2020-03-18 20:54:45--  (try: 2)  https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.18.tar.xz
Connecting to cdn.kernel.org (cdn.kernel.org)|151.101.1.176|:443... connected.
HTTP request sent, awaiting response... 503 first byte timeout
2020-03-18 20:55:46 ERROR 503: first byte timeout.

+wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.18.tar.xz
--2020-03-18 20:55:46--  https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.18.tar.xz
Resolving cdn.kernel.org (cdn.kernel.org)... 151.101.1.176, 151.101.65.176, 151.101.129.176, ...
Connecting to cdn.kernel.org (cdn.kernel.org)|151.101.1.176|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 103076276 (98M) [application/x-xz]
Saving to: ‘linux-4.16.18.tar.xz.1’

linux-4.16.18.tar.x 100%[===================>]  98.30M   186MB/s    in 0.5s

2020-03-18 20:55:56 (186 MB/s) - ‘linux-4.16.18.tar.xz.1’ saved [103076276/103076276]

Fixes: 048674b ("travis: Retry kernel download on 503 first byte timeout.")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
  • Loading branch information
david-marchand authored and igsilya committed Oct 21, 2020
1 parent 91fc374 commit 04d1406
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .travis/linux-build.sh
Expand Up @@ -34,7 +34,9 @@ function install_kernel()

url="${base_url}/linux-${version}.tar.xz"
# Download kernel sources. Try direct link on CDN failure.
wget ${url} || wget ${url} || wget ${url/cdn/www}
wget ${url} ||
(rm -f linux-${version}.tar.xz && wget ${url}) ||
(rm -f linux-${version}.tar.xz && wget ${url/cdn/www})

tar xvf linux-${version}.tar.xz > /dev/null
pushd linux-${version}
Expand Down

0 comments on commit 04d1406

Please sign in to comment.