Merge lp:~toykeeper/wsgi-oops/stop-eating-errors into lp:wsgi-oops

Proposed by Selene ToyKeeper
Status: Merged
Approved by: Selene ToyKeeper
Approved revision: 61
Merged at revision: 60
Proposed branch: lp:~toykeeper/wsgi-oops/stop-eating-errors
Merge into: lp:wsgi-oops
Diff against target: 69 lines (+6/-28)
2 files modified
canonical/oops/serializer.py (+6/-10)
canonical/oops/tests/test_serializer.py (+0/-18)
To merge this branch: bzr merge lp:~toykeeper/wsgi-oops/stop-eating-errors
Reviewer Review Type Date Requested Status
Selene ToyKeeper (community) Approve
Tim Cole (community) Approve
Ricardo Kirkner (community) Needs Information
Review via email: mp+71014@code.launchpad.net

Commit message

Fixed an error in the error logger for the error logger. Oh, metabugs, how do I love thee?

ISD keeps getting blank OOPS reports. It turns out there is an error in the error logger. Wsgi-oops has a failsafe to log that sort of thing, but unfortunately it has a bug too, which results in more blank errors. So, there is an error in the error logger for the error logger. It's kind of a metabug.

This fixes the outer most layer, so the outer errors will show up in the failsafe log. Once this is deployed, I can find out what the original error logger issue is, and fix that. Then after deploying that, I can hopefully find out what the original app errors are.

I basically reverted parts of revno: 43 by natalia.bidart. It seems not to have the desired effect (the code worked only 2 times out of 70615 errors in my log), and even the test for the feature didn't work. It still passed after removing the feature it was supposed to test.

Description of the change

ISD keeps getting blank OOPS reports. It turns out there is an error in the error logger. Wsgi-oops has a failsafe to log that sort of thing, but unfortunately it has a bug too, which results in more blank errors. So, there is an error in the error logger for the error logger. It's kind of a metabug.

This fixes the outer most layer, so the outer errors will show up in the failsafe log. Once this is deployed, I can find out what the original error logger issue is, and fix that. Then after deploying that, I can hopefully find out what the original app errors are.

I basically reverted parts of revno: 43 by natalia.bidart. It seems not to have the desired effect (the code worked only 2 times out of 70615 errors in my log), and even the test for the feature didn't work. It still passed after removing the feature it was supposed to test.

To post a comment you must log in.
Revision history for this message
Ricardo Kirkner (ricardokirkner) wrote :

I'm a bit hesitant about this change. The original code doesn't *look* wrong at first sight. Since this is a shared codebase, I wouldn't want us to "fix" something and break other peoples expectations.

Can we have natalia involved in the review/discussion?

review: Needs Information
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

To clarify, wsgi-oops has *two* failsafes which each attempt to catch and log errors. One is in the file serializer, and one is in the reporter (which calls the serializer). In my logs, I see that the inner failsafe worked twice out of ~70,000 errors, and the outer one worked (sort of) the rest of the time. Unfortunately, the inner failsafe ate the exception most of the time, so the outer failsafe had no traceback to log.

This change removes the inner failsafe, so that the outer one can function properly. From what I can tell from my logs, the inner failsafe isn't working anyway, and I discovered during testing that the test for it doesn't work either. Since they're redundant, I removed them.

Revision history for this message
Tim Cole (tcole) wrote :

Hmm, looks reasonable, particularly since the test was spuriously passing.

review: Approve
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Forwarded from Natalia...

* Natalia Bidart <email address hidden> wrote:
> Hello there!
>
> So, It's been ages (literally) since I don't touch that code, so as
> far as I see there should be not issues with that.
> If Tim Cole says +1, then I say +1 as well.
>
> Cheers, Natalia.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'canonical/oops/serializer.py'
2--- canonical/oops/serializer.py 2010-12-21 00:51:42 +0000
3+++ canonical/oops/serializer.py 2011-08-10 10:11:13 +0000
4@@ -46,7 +46,6 @@
5
6 from datetime import datetime, timedelta
7
8-import logging
9 import os
10 import pytz
11 import re
12@@ -245,15 +244,12 @@
13
14 def dump(self, oops):
15 """Dump OOPS to disk."""
16- dump_filename = None
17- try:
18- dump_filename = self._start_dump(oops)
19- # We need to pass the filename as parameter to avoid
20- # race conditions between threads. Same for an oops.
21- self._write_file(dump_filename, oops)
22- self._finish_dump(dump_filename)
23- except:
24- logging.exception("%s.dump failed.", self.__class__.__name__)
25+ dump_filename = self._start_dump(oops)
26+
27+ # We need to pass the filename as parameter to avoid
28+ # race conditions between threads. Same for an oops.
29+ self._write_file(dump_filename, oops)
30+ self._finish_dump(dump_filename)
31
32 return dump_filename
33
34
35=== modified file 'canonical/oops/tests/test_serializer.py'
36--- canonical/oops/tests/test_serializer.py 2009-11-03 13:55:56 +0000
37+++ canonical/oops/tests/test_serializer.py 2011-08-10 10:11:13 +0000
38@@ -49,11 +49,6 @@
39 'session' : 549855,
40 }
41
42-class CrashyOOPSFileSerializer(OOPSFileSerializer):
43-
44- def start_dump(self, oops):
45- raise Exception
46-
47 class OopsFileSerializerTests(unittest.TestCase):
48 """Test oops file serializer."""
49 serializer_class = OOPSFileSerializer
50@@ -107,19 +102,6 @@
51 self.result = None
52
53
54-class OopsFileSerializerExceptionsTests(OopsFileSerializerTests):
55- """Test oops file serializer exceptions."""
56- serializer_class = CrashyOOPSFileSerializer
57-
58- def setUp(self):
59- """Init this test."""
60- pass
61-
62- def test_dump_catches_exceptions(self):
63- oops = self._build_oops()
64- self.result = self._get_result_from_oops_dump(oops)
65-
66-
67 class OopsRFC822SerializerTests(OopsFileSerializerTests):
68 """Test oops RFC822 serializer."""
69 serializer_class = OOPSRFC822Serializer

Subscribers

People subscribed via source and target branches