Skip to content

Commit

Permalink
Automatically retry failed downloads 3 times
Browse files Browse the repository at this point in the history
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
  • Loading branch information
julian-klode committed Apr 15, 2021
1 parent 9d95c64 commit 1063155
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apt-pkg/acquire-item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions test/integration/test-proxy-connect
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1063155

Please sign in to comment.