← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~lifeless/launchpad/oops into lp:launchpad/devel

 

Robert Collins has proposed merging lp:~lifeless/launchpad/oops into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #627940 of the blocking calls made only database statements are recorded in OOPS
  https://bugs.launchpad.net/bugs/627940
  #630612 Complete b0rkage of oops timing info
  https://bugs.launchpad.net/bugs/630612
  #632022 oops reports show negative total time
  https://bugs.launchpad.net/bugs/632022


Fix timeouts triggered on attempting sql that then do session updates from blowing up and showing a 'could not connect to launchpad' error.
-- 
https://code.launchpad.net/~lifeless/launchpad/oops/+merge/35363
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~lifeless/launchpad/oops into lp:launchpad/devel.
=== 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 @@
             # XXX: This code does not belong here - see bug=636804.
             # Robert Collins 20100913.
             OpStats.stats['timeouts'] += 1
+            # XXX bug=636801 Robert Colins 20100914 This is duplicated from the
+            # statement tracer, because the tracers are not arranged in a stack
+            # rather a queue: the done-code in the statement tracer never runs.
+            action = getattr(connection, '_lp_statement_action', None)
+            if action is not None:
+                # action may be None if the tracer was installed after the
+                # statement was submitted.
+                action.finish()
             info = sys.exc_info()
             transaction.doom()
             try:
@@ -564,8 +572,8 @@
                                        statement, params):
         action = getattr(connection, '_lp_statement_action', None)
         if action is not None:
-            # action may be None if the tracer was installed  the statement was
-            # submitted.
+            # action may be None if the tracer was installed after the
+            # statement was submitted.
             action.finish()
 
     def connection_raw_execute_error(self, connection, raw_cursor,

=== 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 @@
         self.detail = detail
         self.timeline = timeline
 
+    def __repr__(self):
+        return "<TimedAction %s[%s]>" % (self.category, self.detail[:20])
+
     def logTuple(self):
         """Return a 4-tuple suitable for errorlog's use."""
         offset = self._td_to_ms(self.start - self.timeline.baseline)