Merge lp:~mterry/sessioninstaller/no-defer-twice into lp:sessioninstaller

Proposed by Michael Terry on 2013-03-14
Status: Merged
Merged at revision: 141
Proposed branch: lp:~mterry/sessioninstaller/no-defer-twice
Merge into: lp:sessioninstaller
Diff against target: 12 lines (+2/-0)
1 file modified
sessioninstaller/backends/aptd.py (+2/-0)
To merge this branch: bzr merge lp:~mterry/sessioninstaller/no-defer-twice
Reviewer Review Type Date Requested Status
Michael Vogt 2013-03-14 Approve on 2013-03-15
Review via email: mp+153445@code.launchpad.net

Description of the change

Back in the day, I tried to fix bug 848605 with r130.

But that caused bug 1042231, fixed in r132.

But r132 re-opened the original issue. This branch hopefully fixes both issues.

Just checking for deferred call state was the simplest fix I could think of. We still need error_handler in case there is such a problem in aptdaemon that it never even gets to emit "finished".

Though in cases like bug 1056545, aptdaemon calls error_handler because it times out, but then later the dialog emits "finished" when the user cancels the policykit prompt. So we should guard against that.

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

Looked good to me, thanks.

review: Approve
Martin Pitt (pitti) wrote :

I actually merged this now.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sessioninstaller/backends/aptd.py'
2--- sessioninstaller/backends/aptd.py 2012-09-19 12:37:26 +0000
3+++ sessioninstaller/backends/aptd.py 2013-03-14 19:04:35 +0000
4@@ -54,6 +54,8 @@
5 return deferred
6
7 def _on_finished(self, diag, deferred, trans):
8+ if deferred.called:
9+ return # Already called, likely from error_handler (LP: #1056545)
10 if trans.error:
11 deferred.errback(trans.error)
12 else:

Subscribers

People subscribed via source and target branches