Your message dated Tue, 20 May 2025 21:12:55 +0200
with message-id <e5995e5a-3863-49d0-bb35-603d330e5...@wp.pl>
and subject line Re: Bug#869859: Please set Acquire::Retries default to >0
has caused the Debian Bug report #869859,
regarding Please set Acquire::Retries default to >0
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
869859: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=869859
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: apt
Severity: wishlist

Occasionally, networks (such as the internet) are unreliable. I have observed
many transient network failures, be it between my machines and the Debian mirror
network, or be it in the CDNs behind deb.debian.org. This causes pain in
many different scenarios; I’d like to provide just two recent examples:

• Scheduled software updates (think a cron job at night time) are delayed
  unnecessarily because the update fails due to a transient network hickup which
  isn’t retried.

• Continuous integration builds on platforms such as travis-ci.org fail due to
  transient network hickups, confusing users and making them click the retry
  button for the entire build, wasting time and resources.

AFAICT, apt currently never retries HTTP requests by default:

% grep -r Acquire::Retries apt-1.5\~beta1 
apt-1.5~beta1/apt-pkg/acquire-item.h:    *  Set from Acquire::Retries.
apt-1.5~beta1/apt-pkg/acquire-item.h:    *  Acquire::Retries.
apt-1.5~beta1/apt-pkg/acquire-item.cc:   Retries = 
_config->FindI("Acquire::Retries",0);
apt-1.5~beta1/apt-pkg/acquire-item.cc:   Retries = 
_config->FindI("Acquire::Retries",0);

We should increase the default value of 0 to, say, 3.

Thanks for considering,

-- Package-specific info:

-- (no /etc/apt/preferences present) --


-- (no /etc/apt/preferences.d/* present) --


-- (/etc/apt/sources.list present, but not submitted) --


-- (/etc/apt/sources.list.d/bazel.list present, but not submitted) --


-- (/etc/apt/sources.list.d/cc65.list present, but not submitted) --


-- (/etc/apt/sources.list.d/google-chrome.list present, but not submitted) --


-- (/etc/apt/sources.list.d/keybase.list present, but not submitted) --


-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armel, mipsel, arm64

Kernel: Linux 4.9.0-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- no debconf information

--- End Message ---
--- Begin Message ---
Version: 2.3.2

Hi!

AFAICT, apt currently never retries HTTP requests by default:

% grep -r Acquire::Retries apt-1.5\~beta1
apt-1.5~beta1/apt-pkg/acquire-item.h:    *  Set from Acquire::Retries.
apt-1.5~beta1/apt-pkg/acquire-item.h:    *  Acquire::Retries.
apt-1.5~beta1/apt-pkg/acquire-item.cc:   Retries = 
_config->FindI("Acquire::Retries",0);
apt-1.5~beta1/apt-pkg/acquire-item.cc:   Retries = 
_config->FindI("Acquire::Retries",0);

We should increase the default value of 0 to, say, 3.


This request appears to be implemented in
https://salsa.debian.org/apt-team/apt/-/commit/10631550f1.

See also
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1876035



Testing procedure:

A. Configure a repo server

The server is a Debian machine in the same network in which apt client
will be running. The machine won't be responding to TCP SYN sent to TCP
port 80 (default http port) due to this line in iptables:

iptables -I INPUT -p tcp --destination-port 80 -j DROP

Server's IP is 10.0.0.237.



B. Prepare Debian bookorm machine on which apt will be executed.

acerion@debian:~$ grep CODENAME /etc/os-release
VERSION_CODENAME=bookworm
acerion@debian:~$ cat /etc/apt/sources.list
deb [trusted=yes] http://10.0.0.237/12 ./
acerion@debian:~$
acerion@debian:~$



C. Reproduction with apt before fix (compiled from 9d95c64be8 +
compilation fix from 4dd5e241af).

acerion@debian:~$ apt --version
apt 2.3.1 (amd64)
acerion@debian:~$
acerion@debian:~$
acerion@debian:~$ sudo apt-get update
Err:1 http://10.0.0.237/12 ./ InRelease
  Could not connect to 10.0.0.237:80 (10.0.0.237), connection timed out
Reading package lists... Done
W: Failed to fetch http://10.0.0.237/12/./InRelease  Could not connect to 
10.0.0.237:80 (10.0.0.237), connection timed out
W: Some index files failed to download. They have been ignored, or old ones 
used instead.
acerion@debian:~$
acerion@debian:~$
acerion@debian:~$ sudo apt-get -o "Acquire::Retries=1" update
Ign:1 http://10.0.0.237/12 ./ InRelease
Err:1 http://10.0.0.237/12 ./ InRelease
  Could not connect to 10.0.0.237:80 (10.0.0.237), connection timed out
Reading package lists... Done
W: Failed to fetch http://10.0.0.237/12/./InRelease  Could not connect to 
10.0.0.237:80 (10.0.0.237), connection timed out
W: Some index files failed to download. They have been ignored, or old ones 
used instead.
acerion@debian:~$
acerion@debian:~$
acerion@debian:~$ sudo apt-get -o "Acquire::Retries=3" update
Ign:1 http://10.0.0.237/12 ./ InRelease
Ign:1 http://10.0.0.237/12 ./ InRelease
Ign:1 http://10.0.0.237/12 ./ InRelease
Err:1 http://10.0.0.237/12 ./ InRelease
  Could not connect to 10.0.0.237:80 (10.0.0.237), connection timed out
Reading package lists... Done
W: Failed to fetch http://10.0.0.237/12/./InRelease  Could not connect to 
10.0.0.237:80 (10.0.0.237), connection timed out
W: Some index files failed to download. They have been ignored, or old ones 
used instead.



D. Reproduction with apt after fix (compiled from 10631550f1 +
compilation fix from 4dd5e241af).

acerion@debian:~$ sudo apt-get update
Ign:1 http://10.0.0.237/12 ./ InRelease
Ign:1 http://10.0.0.237/12 ./ InRelease
Ign:1 http://10.0.0.237/12 ./ InRelease
Err:1 http://10.0.0.237/12 ./ InRelease
  Could not connect to 10.0.0.237:80 (10.0.0.237), connection timed out
Reading package lists... Done
W: Failed to fetch http://10.0.0.237/12/./InRelease  Could not connect to 
10.0.0.237:80 (10.0.0.237), connection timed out
W: Some index files failed to download. They have been ignored, or old ones 
used instead.
acerion@debian:~$
acerion@debian:~$
acerion@debian:~$ sudo apt-get -o "Acquire::Retries=1" update
Ign:1 http://10.0.0.237/12 ./ InRelease
Err:1 http://10.0.0.237/12 ./ InRelease
  Could not connect to 10.0.0.237:80 (10.0.0.237), connection timed out
Reading package lists... Done
W: Failed to fetch http://10.0.0.237/12/./InRelease  Could not connect to 
10.0.0.237:80 (10.0.0.237), connection timed out
W: Some index files failed to download. They have been ignored, or old ones 
used instead.
acerion@debian:~$
acerion@debian:~$
acerion@debian:~$ sudo apt-get -o "Acquire::Retries=4" update
Ign:1 http://10.0.0.237/12 ./ InRelease
Ign:1 http://10.0.0.237/12 ./ InRelease
Ign:1 http://10.0.0.237/12 ./ InRelease
Ign:1 http://10.0.0.237/12 ./ InRelease
Err:1 http://10.0.0.237/12 ./ InRelease
  Could not connect to 10.0.0.237:80 (10.0.0.237), connection timed out
Reading package lists... Done
W: Failed to fetch http://10.0.0.237/12/./InRelease  Could not connect to 
10.0.0.237:80 (10.0.0.237), connection timed out
W: Some index files failed to download. They have been ignored, or old ones 
used instead.
acerion@debian:~$



E. Reproduction with apt 3.0.1 from sid/trixie

acerion@debian:~$ grep CODENAME /etc/os-release
VERSION_CODENAME=trixie
acerion@debian:~$ apt --version
apt 3.0.1 (amd64)
acerion@debian:~$ sudo apt-get update
Ign:1 http://10.0.0.237/12 ./ InRelease
Ign:1 http://10.0.0.237/12 ./ InRelease
Ign:1 http://10.0.0.237/12 ./ InRelease
Err:1 http://10.0.0.237/12 ./ InRelease
  Could not connect to 10.0.0.237:80 (10.0.0.237), connection timed out
  Unable to connect to 10.0.0.237:http:
Reading package lists... Done
W: Failed to fetch http://10.0.0.237/12/./InRelease  Unable to connect to 
10.0.0.237:http:
W: Some index files failed to download. They have been ignored, or old ones 
used instead.
N: Some sources can be modernized. Run 'apt modernize-sources' to do so.
acerion@debian:~$

Judging by the count of "Ign"-prefixed messages (and judging by the code
in repo), apt 3.1.0 still uses 3 as default value of the "Acquire::Retries"
parameter.



As you can see, apt prints "Ign" message N times, where N corresponds
with value of "Acquire::Retries". After the fix, the value if repeated
"Ign" messages is 3 by default. I have not observed a correlation
between value of Retires and a count of TCP SYN packets (or their
retransmissions) sent to server.

I guess that the presence/count of "Ign" messages is the indicator of
behaviour expected in the ticket.

Based on all the info above, I'm closing this ticket.

Kamil

--- End Message ---

Reply via email to