Eats CPU and memory due to slighly misconfigured OOPSObserver
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Critical
|
Gavin Panella | ||
python-oops-twisted |
Fix Released
|
High
|
Gavin Panella | ||
txlongpoll |
Fix Released
|
Critical
|
Gavin Panella |
Bug Description
In txlongpoll, an observer is created by getRotatableLog
and passed as the fallback parameter to OOPSObserver. The docstring
for OOPSObserver.
:param fallback: If supplied, a LogObserver to pass
when an OOPS has occurred.
However, it actually expects a callable, but this does not cause an
error until later.
I'm not quite sure why it doesn't happen every time, but what can
happen is that the txlongpoll process spins tightly and comsumes more
and more memory. I've attached an example log that is recorded.
The following diff, I think, will resolve this issue in txlongpoll:
{{{
=== modified file 'twisted/
--- twisted/
+++ twisted/
@@ -67,7 +67,7 @@
repo = DateDirRepo(
- observer = OOPSObserver(
+ observer = OOPSObserver(
addObserve
}}}
To avoid this kind of issue in the future, I propose doing something
like the following in python-oops-twisted:
{{{
=== modified file 'oops_twisted/
--- oops_twisted/log.py 2011-09-28 09:00:46 +0000
+++ oops_twisted/log.py 2011-10-06 19:57:22 +0000
@@ -41,6 +41,7 @@
"""
+ assert fallback is None or callable(fallback)
def emit(self, eventDict):
}}}
Related branches
- Gavin Panella: Approve
-
Diff: 10 lines (+1/-1)1 file modifiedtwisted/plugins/txlongpoll.py (+1/-1)
- j.c.sackett (community): Approve
-
Diff: 23 lines (+3/-2)1 file modifiedoops_twisted/log.py (+3/-2)
- Gavin Panella (community): Approve
- Diff: 0 lines
Changed in launchpad: | |
status: | New → In Progress |
importance: | Undecided → Critical |
assignee: | nobody → Gavin Panella (allenap) |
Changed in python-oops-twisted: | |
assignee: | nobody → Gavin Panella (allenap) |
status: | Triaged → In Progress |
Changed in launchpad: | |
status: | In Progress → Fix Committed |
Changed in python-oops-twisted: | |
status: | In Progress → Fix Committed |
Changed in txlongpoll: | |
status: | In Progress → Fix Released |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
Changed in python-oops-twisted: | |
status: | Fix Committed → Fix Released |
Nice catch. I thought callable was deprecated?