Merge lp:~gary-lasker/software-center/fix-crash-lp960742 into lp:software-center

Proposed by Gary Lasker on 2012-03-22
Status: Merged
Merged at revision: 2909
Proposed branch: lp:~gary-lasker/software-center/fix-crash-lp960742
Merge into: lp:software-center
Diff against target: 16 lines (+5/-1)
1 file modified
utils/expunge-cache.py (+5/-1)
To merge this branch: bzr merge lp:~gary-lasker/software-center/fix-crash-lp960742
Reviewer Review Type Date Requested Status
Michael Vogt 2012-03-22 Approve on 2012-03-22
Review via email: mp+98766@code.launchpad.net

Description of the change

Proposed fix for crasher bug 960742. Please see the bug report for details and the stacktrace.

Thanks!

To post a comment you must log in.
Michael Vogt (mvo) wrote :

Thanks, looks good. I guess this is caused by a race condition when multiple expunge-cache processes run, but that should be fine, i.e. I don't think we need locking here.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utils/expunge-cache.py'
2--- utils/expunge-cache.py 2012-03-15 10:43:13 +0000
3+++ utils/expunge-cache.py 2012-03-22 01:33:30 +0000
4@@ -25,7 +25,11 @@
5 print "Would delete: %s" % f
6 else:
7 logging.debug("Deleting: %s" % f)
8- os.unlink(f)
9+ try:
10+ os.unlink(f)
11+ except OSError as e:
12+ logging.warn("When expunging the cache, could not unlink "
13+ "file '%s' (%s)'" % (f, e))
14
15 def clean(self):
16 # go over the directories

Subscribers

People subscribed via source and target branches