https://salsa.debian.org/blade/apt-cacher-ng
Solution: bump to apt-cacher-ng=3.5-3 from debian-bullseye.
| Problem / property | salsa #25 patch (one-line guard) | Ponsinet (Debian #1022043, 2026) | Woodall (Debian #1022043, 2024) |
|---|---|---|---|
Premature “stuck” displacement of a download that has not received headers yet (m_nTimeDlStarted == 0) | fixed: makeWay requires m_nTimeDlStarted != 0 | ||
Rename collision in the same second (link() EEXIST, “Failure to move file”, 503) | not fixed | fixed: counter added to the renamed file name | avoided as long as there is no displacement |
| Several clients each starting their own download of the same file | not fixed | not fixed | fixed: static mutex + set of in-progress URLs in job::Prepare() |
| Detection of a download that hangs before headers arrive | disabled (never counted as stuck) | kept (counted from item creation) | unchanged |
| Locking added | none | none | yes (inProgressLock) |
| Files touched | src/acregistry.cc (1 line) | src/acregistry.cc | src/job.h, src/job.cc, CMakeLists.txt |
| Reported working | no reports found (AI-authored, “Upstream-Status: Pending”) | author reports it deployed together with Woodall's | Mundt (Debian), Kaiser (38 sites) |
| Applied upstream / in Debian | no | no | no |
Which one solves the problem
job::Prepare() holds a global mutex, and a client asking for a URL that is already in progress attaches to the existing item instead of creating a new one. That avoids displacement, the same-second rename collision, and duplicate downloads in one change. Reports from Mundt (Debian) and Kaiser (38 sites) say it works, but it isn't a full cure: Ovsík still saw bad signatures with it on 3.7.5. m_nTimeDlStarted when the item is created, and adds a counter to the renamed file name. That covers any caller of Create(), not only job.