meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sw:apt-cacher-ng:issues [2026/11/27 12:33] – niziaksw:apt-cacher-ng:issues [2026/11/27 13:01] (current) – niziak
Line 11: Line 11:
   *    * 
   * [[https://bugs.launchpad.net/ubuntu/+source/apt-cacher-ng/+bug/1983856|apt clients stuck on parallel access]]   * [[https://bugs.launchpad.net/ubuntu/+source/apt-cacher-ng/+bug/1983856|apt clients stuck on parallel access]]
 +  * [[https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1022043|#1022043 apt-cacher-ng: sometimes fails to download some index files - maybe a race condition]]
  
  
Line 18: Line 19:
  
 Solution: bump to ''apt-cacher-ng=3.5-3'' from ''debian-bullseye''. Solution: bump to ''apt-cacher-ng=3.5-3'' from ''debian-bullseye''.
 +
 +
 +==== patches comparison ====
 +
 +^ 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'' | fixed: ''m_nTimeDlStarted'' set when the  
 +  item is created | avoided: second client attaches to the existing job, no displacement |                                                                                                                         
 +| 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                                                                                                                                                                                     
 +  * **Woodall** fixes the core race. ''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.                                                                                                                                                                                              
 +  * **Ponsinet** fixes the two defects in the registry itself. It sets ''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.       
 +  * **#25** is a subset of Ponsinet's first change. It doesn't fix the rename collision, and it disables the stuck detection before headers arrive.                                                                    
 +  * **Best set** Woodall + Ponsinet. They apply cleanly together, and Ponsinet reports running both in production. I'd skip the #25 patch if you use Ponsinet's. 
 +                                                             
 +
 +