[Twisted-Python] Moderately-long running processes timing out in Twisted

Jean-Paul Calderone exarkun at divmod.com
Fri Sep 5 14:20:01 EDT 2008


On Fri, 5 Sep 2008 11:06:25 -0700 (PDT), Steve Lewis <spiritualmechanic at yahoo.com> wrote:
>I looked at the adbapi code and it appears the ConnectionLost exception is coming from there, not from cx_Oracle. At least that's what is in the error log:
>
>2008-09-05 12:25:48-0400 [HTTPChannel,9003,127.0.0.1] adbapi closing: cx_Oracle
>2008-09-05 12:25:48-0400 [HTTPChannel,9003,127.0.0.1] Connection lost.
>2008-09-05 12:25:48-0400 [-] Unhandled Error
>        Traceback (most recent call last):
>          File "/opt/Python25/lib/python2.5/threading.py", line 440, in run
>            self.__target(*self.__args, **self.__kwargs)
>          File "/opt/python/lib/python2.5/site-packages/twisted/python/threadpool.py", line 161, in _worker
>            context.call(ctx, function, *args, **kwargs)
>          File "/opt/python/lib/python2.5/site-packages/twisted/python/context.py", line 59, in callWithContext
>            return self.currentContext().callWithContext(ctx, func, *args, **kw)
>          File "/opt/python/lib/python2.5/site-packages/twisted/python/context.py", line 37, in callWithContext
>            return func(*args,**kw)
>        --- <exception caught here> ---
>          File "/opt/python/lib/python2.5/site-packages/twisted/internet/threads.py", line 24, in _putResultInDeferred
>            result = f(*args, **kwargs)
>          File "/opt/python/lib/python2.5/site-packages/twisted/enterprise/adbapi.py", line 380, in _runInteraction
>            conn.rollback()
>          File "/opt/python/lib/python2.5/site-packages/twisted/enterprise/adbapi.py", line 65, in rollback
>            raise ConnectionLost()
>        twisted.enterprise.adbapi.ConnectionLost:
>
>I don't know what
>
>        --- <exception caught here> ---
>
>means. I'm guessing there's some sort of issue with Oracle but our DBA didn't see anything obvious in his logs. Is there a way for me to tell what exactly the "exception caught here" is?
>

"exception caught here" is telling you where in the call stack the exception
was caught. Frames above it weren't escaped by the exception. Frames below
it were.

I think you're seeing an example of poor error reporting in adbapi.  This
has recently been improved and the improvements will be included in the
next release of Twisted.  If you can somehow test a recent trunk revision
of Twisted, you might find that it reports a more specific problem which
points to the actual cause of the failure.

What this does indicate, I think, is that you had a transaction which
could not be committed for some reason.  adbapi is rolling back the
transaction before reporting the reason the commit failed.  However,
the ConnectionLost exception, which is boring and not really relevant
to anything you're doing, is happening before the real exception can be
reported.

Jean-Paul




More information about the Twisted-Python mailing list