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
=== modified file 'lib/canonical/launchpad/webapp/adapter.py'
--- lib/canonical/launchpad/webapp/adapter.py 2010-09-13 04:45:59 +0000
+++ lib/canonical/launchpad/webapp/adapter.py 2010-09-14 04:57:48 +0000
@@ -512,6 +512,14 @@
512 # XXX: This code does not belong here - see bug=636804.512 # XXX: This code does not belong here - see bug=636804.
513 # Robert Collins 20100913.513 # Robert Collins 20100913.
514 OpStats.stats['timeouts'] += 1514 OpStats.stats['timeouts'] += 1
515 # XXX bug=636801 Robert Colins 20100914 This is duplicated from the
516 # statement tracer, because the tracers are not arranged in a stack
517 # rather a queue: the done-code in the statement tracer never runs.
518 action = getattr(connection, '_lp_statement_action', None)
519 if action is not None:
520 # action may be None if the tracer was installed after the
521 # statement was submitted.
522 action.finish()
515 info = sys.exc_info()523 info = sys.exc_info()
516 transaction.doom()524 transaction.doom()
517 try:525 try:
@@ -564,8 +572,8 @@
564 statement, params):572 statement, params):
565 action = getattr(connection, '_lp_statement_action', None)573 action = getattr(connection, '_lp_statement_action', None)
566 if action is not None:574 if action is not None:
567 # action may be None if the tracer was installed the statement was575 # action may be None if the tracer was installed after the
568 # submitted.576 # statement was submitted.
569 action.finish()577 action.finish()
570578
571 def connection_raw_execute_error(self, connection, raw_cursor,579 def connection_raw_execute_error(self, connection, raw_cursor,
572580
=== modified file 'lib/lp/services/timeline/timedaction.py'
--- lib/lp/services/timeline/timedaction.py 2010-09-06 22:41:18 +0000
+++ lib/lp/services/timeline/timedaction.py 2010-09-14 04:57:48 +0000
@@ -43,6 +43,9 @@
43 self.detail = detail43 self.detail = detail
44 self.timeline = timeline44 self.timeline = timeline
4545
46 def __repr__(self):
47 return "<TimedAction %s[%s]>" % (self.category, self.detail[:20])
48
46 def logTuple(self):49 def logTuple(self):
47 """Return a 4-tuple suitable for errorlog's use."""50 """Return a 4-tuple suitable for errorlog's use."""
48 offset = self._td_to_ms(self.start - self.timeline.baseline)51 offset = self._td_to_ms(self.start - self.timeline.baseline)