Merge lp:~glatzor/aptdaemon/maverick-updates into lp:ubuntu/maverick-updates/aptdaemon

Proposed by Sebastian Heinlein
Status: Needs review
Proposed branch: lp:~glatzor/aptdaemon/maverick-updates
Merge into: lp:ubuntu/maverick-updates/aptdaemon
Diff against target: 135 lines (+77/-1)
6 files modified
.pc/applied-patches (+1/-0)
aptdaemon/lock.py (+2/-1)
aptdaemon/worker.py (+10/-0)
debian/changelog (+11/-0)
debian/patches/09_fix_index_race_659438.patch (+52/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~glatzor/aptdaemon/maverick-updates
Reviewer Review Type Date Requested Status
Michael Vogt Pending
Review via email: mp+43609@code.launchpad.net

Description of the change

Mvo, could you please merge this branch, since I get 10 bug reports about this race every day.

To post a comment you must log in.

Unmerged revisions

49. By Sebastian Heinlein

* debian/patches/09_fix_index_race_659438.patch:
  - If the background cron job rebuilds the apt indexes the
    apt.Cache.required_download method fails, since it tries to access
    the not available indexes. This patch is a workaround since it
    is requires a lock on the indexes before caluclating the size
    (fixes LP: #659438)

48. By Michael Vogt

* debian/patches/06_rosetta_po_update.patch:
  - updated translations from rosetta, this includes the
    policy.in files that can not be updated via language-packs
    (LP: #655642)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.pc/applied-patches'
2--- .pc/applied-patches 2010-10-20 10:12:52 +0000
3+++ .pc/applied-patches 2010-12-14 06:06:12 +0000
4@@ -2,3 +2,4 @@
5 06_rosetta_po_update.patch
6 07_fix-race-597017.patch
7 08_fix_deb_install.patch
8+09_fix_index_race_659438.patch
9
10=== modified file 'aptdaemon/lock.py'
11--- aptdaemon/lock.py 2010-10-05 18:04:52 +0000
12+++ aptdaemon/lock.py 2010-12-14 06:06:12 +0000
13@@ -19,7 +19,8 @@
14
15 __author__ = "Sebastian Heinlein <devel@glatzor.de>"
16
17-__all__ = ("LockFailedError", "system")
18+__all__ = ("LockFailedError", "lists_lock", "status_lock", "archive_lock",
19+ "acquire", "release", "FileLock")
20
21 import fcntl
22 import os
23
24=== modified file 'aptdaemon/worker.py'
25--- aptdaemon/worker.py 2010-10-20 10:12:52 +0000
26+++ aptdaemon/worker.py 2010-12-14 06:06:12 +0000
27@@ -765,13 +765,23 @@
28 log.info("Simulating trans: %s" % trans.tid)
29 trans.status = STATUS_RESOLVING_DEP
30 try:
31+ lock.lists_lock.acquire()
32 return self._simulate_helper(trans, status_path)
33+ except lock.LockFailedError, error:
34+ if error.process:
35+ msg = "The package indexes are currently changed " \
36+ "by %s." % error.process
37+ else:
38+ msg = "Another package manager changes the package indexes" \
39+ "currently."
40+ trans.error = TransactionFailed(ERROR_NO_LOCK, msg)
41 except TransactionFailed, excep:
42 trans.error = excep
43 except Exception, excep:
44 trans.error = TransactionFailed(ERROR_UNKNOWN,
45 traceback.format_exc())
46 finally:
47+ lock.lists_lock.release()
48 trans.status = STATUS_SETTING_UP
49 trans.exit = EXIT_FAILED
50 trans.progress = 100
51
52=== modified file 'debian/changelog'
53--- debian/changelog 2010-10-20 10:12:52 +0000
54+++ debian/changelog 2010-12-14 06:06:12 +0000
55@@ -1,3 +1,14 @@
56+aptdaemon (0.31+bzr506-0ubuntu5) maverick-proposed; urgency=low
57+
58+ * debian/patches/09_fix_index_race_659438.patch:
59+ - If the background cron job rebuilds the apt indexes the
60+ apt.Cache.required_download method fails, since it tries to access
61+ the not available indexes. This patch is a workaround since it
62+ is requires a lock on the indexes before caluclating the size
63+ (LP: #659438)
64+
65+ -- Sebastian Heinlein <devel@glatzor.de> Sat, 11 Dec 2010 11:00:50 +0100
66+
67 aptdaemon (0.31+bzr506-0ubuntu4) maverick-proposed; urgency=low
68
69 * debian/patches/06_rosetta_po_update.patch:
70
71=== added file 'debian/patches/09_fix_index_race_659438.patch'
72--- debian/patches/09_fix_index_race_659438.patch 1970-01-01 00:00:00 +0000
73+++ debian/patches/09_fix_index_race_659438.patch 2010-12-14 06:06:12 +0000
74@@ -0,0 +1,52 @@
75+Description: Lock list indexes before performing a simulate
76+ The apt.Cache.required_download properties accesses the list indexes.
77+ If the indexes are currently recreated/updated by e.g. an background
78+ cron job this will result in the following error:
79+ SystemError: I wasn't able to locate file for the XXX package.
80+ This might mean you need to manually fix this package.
81+Author: Sebastian Heinlein <devel@glatzor.de>
82+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/aptdaemon/+bug/659438
83+Origin: other
84+
85+Index: maverick-updates/aptdaemon/worker.py
86+===================================================================
87+--- maverick-updates.orig/aptdaemon/worker.py 2010-12-11 10:57:03.732132000 +0100
88++++ maverick-updates/aptdaemon/worker.py 2010-12-13 06:07:02.747673948 +0100
89+@@ -765,13 +765,23 @@
90+ log.info("Simulating trans: %s" % trans.tid)
91+ trans.status = STATUS_RESOLVING_DEP
92+ try:
93++ lock.lists_lock.acquire()
94+ return self._simulate_helper(trans, status_path)
95++ except lock.LockFailedError, error:
96++ if error.process:
97++ msg = "The package indexes are currently changed " \
98++ "by %s." % error.process
99++ else:
100++ msg = "Another package manager changes the package indexes" \
101++ "currently."
102++ trans.error = TransactionFailed(ERROR_NO_LOCK, msg)
103+ except TransactionFailed, excep:
104+ trans.error = excep
105+ except Exception, excep:
106+ trans.error = TransactionFailed(ERROR_UNKNOWN,
107+ traceback.format_exc())
108+ finally:
109++ lock.lists_lock.release()
110+ trans.status = STATUS_SETTING_UP
111+ trans.exit = EXIT_FAILED
112+ trans.progress = 100
113+Index: maverick-updates/aptdaemon/lock.py
114+===================================================================
115+--- maverick-updates.orig/aptdaemon/lock.py 2010-12-13 06:07:15.179672286 +0100
116++++ maverick-updates/aptdaemon/lock.py 2010-12-13 06:08:58.459685399 +0100
117+@@ -19,7 +19,8 @@
118+
119+ __author__ = "Sebastian Heinlein <devel@glatzor.de>"
120+
121+-__all__ = ("LockFailedError", "system")
122++__all__ = ("LockFailedError", "lists_lock", "status_lock", "archive_lock",
123++ "acquire", "release", "FileLock")
124+
125+ import fcntl
126+ import os
127
128=== modified file 'debian/patches/series'
129--- debian/patches/series 2010-10-20 10:12:52 +0000
130+++ debian/patches/series 2010-12-14 06:06:12 +0000
131@@ -2,3 +2,4 @@
132 06_rosetta_po_update.patch
133 07_fix-race-597017.patch
134 08_fix_deb_install.patch
135+09_fix_index_race_659438.patch

Subscribers

People subscribed via source and target branches