summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2021-04-15 19:23:21 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2021-04-15 19:36:47 +0200
commit10631550f1f9788bdfd64d2434237a1448ab0626 (patch)
treebeab71c20e3add30f7743b51d11bbdbf8711a1af
parent9d95c64be8dd5a74efb7bcd134f6425c837c22ca (diff)
Automatically retry failed downloads 3 times
Enable the Acquire::Retries option by default, set to 3. This will help with slightly unreliable networking; future work is needed for adding backoff and SRV/IP rotation. LP: #1876035 Gbp-Dch: full
-rw-r--r--apt-pkg/acquire-item.cc2
-rwxr-xr-xtest/integration/test-proxy-connect9
2 files changed, 10 insertions, 1 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 2bab7d5c0..225c4304a 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -770,7 +770,7 @@ class APT_HIDDEN CleanupItem : public pkgAcqTransactionItem /*{{{*/
// Acquire::Item::Item - Constructor /*{{{*/
pkgAcquire::Item::Item(pkgAcquire * const owner) :
FileSize(0), PartialSize(0), ID(0), Complete(false), Local(false),
- QueueCounter(0), ExpectedAdditionalItems(0), Retries(_config->FindI("Acquire::Retries", 0)), Owner(owner), d(new Private())
+ QueueCounter(0), ExpectedAdditionalItems(0), Retries(_config->FindI("Acquire::Retries", 3)), Owner(owner), d(new Private())
{
Owner->Add(this);
Status = StatIdle;
diff --git a/test/integration/test-proxy-connect b/test/integration/test-proxy-connect
index 17927c9db..579bab387 100755
--- a/test/integration/test-proxy-connect
+++ b/test/integration/test-proxy-connect
@@ -19,4 +19,13 @@ echo "Acquire::http::Proxy \"http://localhost:${APTHTTPPORT}\";" > rootdir/etc/a
aptget update >/dev/null 2>&1
testsuccessequal "CONNECT example.example:443 HTTP/1.1\r
+Host: example.example:443\r
+--
+CONNECT example.example:443 HTTP/1.1\r
+Host: example.example:443\r
+--
+CONNECT example.example:443 HTTP/1.1\r
+Host: example.example:443\r
+--
+CONNECT example.example:443 HTTP/1.1\r
Host: example.example:443\r" grep -A1 "^CONNECT" aptarchive/webserver.log