should clean pkgcache.bin.* and srcpkgcache.bin.*

Bug #1045704 reported by Sebastien Bacher
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
High
Unassigned
Precise
Won't Fix
High
Unassigned

Bug Description

TEST CASE:
1. do sudo touch /var/cache/apt/pkgcache.bin.xxx to simulate atmoic write that did not get cleaned up
2. run sudo apt-get update
3. verify that the file is still there

4. install apt from precise-proposed
5. run sudo apt-get update
6. verify that the file is now cleaned up

The issue is reported from a precise system upgraded over time, it seems that pkgcache.bin.<random> and srcpkgcache.bin.<random> are left over time in /var/cache/apt/, those should be cleaned

Revision history for this message
Michael Vogt (mvo) wrote :

Based on irc:
<mvo> seb128: you got 2gb of those, right?
<seb128> mvo, yes

setting to high.

Changed in apt (Ubuntu):
status: New → In Progress
importance: Undecided → High
Revision history for this message
Julian Andres Klode (juliank) wrote :

So, what should we do about this? Revert to non-atomic replacements, use a fixed filename (pkgcache.bin.tmp, brings a race condition), or add a signal handler that cleans up those files on SIGINT -- which I assume is the reason there are so many files, as we rename the temporaries to the final name if the code is not interrupted.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Rsync does the signal handler solution, which seems to be the best option. If we receive SIGINT, SIGHUP, or SIGTERM, we should remove all temporary files we created. If we only have one temporary file at a time, the solution is relatively easy (a global variable), if we have multiple temporary files, we need to have a global list of items.

Revision history for this message
Michael Vogt (mvo) wrote :

This got fixed in 0.8.16~exp13 (Closes: #650513) so probably worth a backport.

Changed in apt (Ubuntu):
status: In Progress → Fix Released
Changed in apt (Ubuntu Precise):
status: New → Triaged
Revision history for this message
Michael Vogt (mvo) wrote :

For this particular instance of the pkgcache(es) I should add, the general problem itself is still there.

Revision history for this message
Michael Vogt (mvo) wrote :

The fix is here:
$ bzr diff -r 2129.13.9..2129.13.10 lp:~mvo/apt/debian-sid

Michael Vogt (mvo)
description: updated
Changed in apt (Ubuntu Precise):
importance: Undecided → High
status: Triaged → In Progress
Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in apt (Ubuntu Precise):
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.