Merge lp:~marcustomlinson/update-manager/update-manager into lp:update-manager

Proposed by Marcus Tomlinson on 2020-05-28
Status: Merged
Merged at revision: 2890
Proposed branch: lp:~marcustomlinson/update-manager/update-manager
Merge into: lp:update-manager
Diff against target: 50 lines (+14/-3)
2 files modified
UpdateManager/backend/__init__.py (+7/-3)
debian/changelog (+7/-0)
To merge this branch: bzr merge lp:~marcustomlinson/update-manager/update-manager
Reviewer Review Type Date Requested Status
Brian Murray 2020-05-28 Approve on 2020-06-01
Ubuntu Core Development Team 2020-05-28 Pending
Review via email: mp+384709@code.launchpad.net

Commit message

Fix hang (LP: #1874591) and crash (LP: #1880987) in snap updates.

To post a comment you must log in.
2890. By Marcus Tomlinson on 2020-05-28

Fix hang (LP: #1874591) and crash (LP: #1880987) in snap updates

Brian Murray (brian-murray) wrote :

Thanks for the crash fix, I should have put some more effort into thinking about how to fix it!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UpdateManager/backend/__init__.py'
2--- UpdateManager/backend/__init__.py 2020-04-23 15:17:55 +0000
3+++ UpdateManager/backend/__init__.py 2020-05-28 09:38:10 +0000
4@@ -113,8 +113,10 @@
5 self.window_main.cache._initDepCache()
6 cache = self.window_main.cache
7 except Exception as e:
8+ # just return an empty array for now, it's perfectly safe to
9+ # postpone this duplicates check to a later update.
10 logging.debug("error reading cache (%s)" % e)
11- cache = None
12+ return []
13
14 duplicates = []
15 seeded_snaps, _ = self.get_snap_seeds()
16@@ -301,7 +303,8 @@
17 #close_after_install = False
18
19 if action == self.ACTION_INSTALL:
20- if success and os.path.exists("/usr/bin/snap"):
21+ if (success and os.path.exists("/usr/bin/snap")
22+ and hasattr(self, 'pane_update_progress')):
23 Thread(target=self.update_snaps).start()
24 elif success:
25 self.window_main.start_available()
26@@ -315,7 +318,8 @@
27 else:
28 if error_string:
29 self.window_main.start_error(True, error_string, error_desc)
30- elif success and os.path.exists("/usr/bin/snap"):
31+ elif (success and os.path.exists("/usr/bin/snap")
32+ and hasattr(self, 'pane_update_progress')):
33 self.window_main.duplicate_packages = self.get_deb2snap_dups()
34 self.window_main.start_available()
35 else:
36
37=== modified file 'debian/changelog'
38--- debian/changelog 2020-05-27 20:29:41 +0000
39+++ debian/changelog 2020-05-28 09:38:10 +0000
40@@ -1,3 +1,10 @@
41+update-manager (1:20.04.12) groovy; urgency=medium
42+
43+ * Fix hang in apturl-gtk. (LP: #1874591)
44+ * Fix crash in snap updates when refreshing the cache fails. (LP: #1880987)
45+
46+ -- Marcus Tomlinson <marcus.tomlinson@canonical.com> Thu, 28 May 2020 10:11:51 +0100
47+
48 update-manager (1:20.04.11) groovy; urgency=medium
49
50 * UpdateManager/UpdateManager.py: when refreshing the cache and encountering

Subscribers

People subscribed via source and target branches

to status/vote changes: