Merge lp:~lifeless/launchpad/oops into lp:launchpad

Proposed by Robert Collins
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: no longer in the source branch.
Merged at revision: 11543
Proposed branch: lp:~lifeless/launchpad/oops
Merge into: lp:launchpad
Diff against target: 43 lines (+13/-2)
2 files modified
lib/canonical/launchpad/webapp/adapter.py (+10/-2)
lib/lp/services/timeline/timedaction.py (+3/-0)
To merge this branch: bzr merge lp:~lifeless/launchpad/oops
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Review via email: mp+35363@code.launchpad.net

Commit message

Manually close actions when the StatementTracer will not run it closing code path.

Description of the change

Fix timeouts triggered on attempting sql that then do session updates from blowing up and showing a 'could not connect to launchpad' error.

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Looks OK, I take your and William's word that it fixes a real problem :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/webapp/adapter.py'
2--- lib/canonical/launchpad/webapp/adapter.py 2010-09-13 04:45:59 +0000
3+++ lib/canonical/launchpad/webapp/adapter.py 2010-09-14 04:57:48 +0000
4@@ -512,6 +512,14 @@
5 # XXX: This code does not belong here - see bug=636804.
6 # Robert Collins 20100913.
7 OpStats.stats['timeouts'] += 1
8+ # XXX bug=636801 Robert Colins 20100914 This is duplicated from the
9+ # statement tracer, because the tracers are not arranged in a stack
10+ # rather a queue: the done-code in the statement tracer never runs.
11+ action = getattr(connection, '_lp_statement_action', None)
12+ if action is not None:
13+ # action may be None if the tracer was installed after the
14+ # statement was submitted.
15+ action.finish()
16 info = sys.exc_info()
17 transaction.doom()
18 try:
19@@ -564,8 +572,8 @@
20 statement, params):
21 action = getattr(connection, '_lp_statement_action', None)
22 if action is not None:
23- # action may be None if the tracer was installed the statement was
24- # submitted.
25+ # action may be None if the tracer was installed after the
26+ # statement was submitted.
27 action.finish()
28
29 def connection_raw_execute_error(self, connection, raw_cursor,
30
31=== modified file 'lib/lp/services/timeline/timedaction.py'
32--- lib/lp/services/timeline/timedaction.py 2010-09-06 22:41:18 +0000
33+++ lib/lp/services/timeline/timedaction.py 2010-09-14 04:57:48 +0000
34@@ -43,6 +43,9 @@
35 self.detail = detail
36 self.timeline = timeline
37
38+ def __repr__(self):
39+ return "<TimedAction %s[%s]>" % (self.category, self.detail[:20])
40+
41 def logTuple(self):
42 """Return a 4-tuple suitable for errorlog's use."""
43 offset = self._td_to_ms(self.start - self.timeline.baseline)