Re: Tracebacks with gevent and set_wait_callback go "missing"

From: Oliver Beattie <oliver(at)obeattie(dot)com>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: Tracebacks with gevent and set_wait_callback go "missing"
Date: 2012-09-07 10:05:24
Message-ID: CALKtjUPmWWkGGFhoiaM6AP6ttbGtb6oRJB7+vOAg=jKX4F3B4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On 6 September 2012 16:37, Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>wrote:

> On Thu, Sep 6, 2012 at 4:09 PM, Oliver Beattie <oliver(at)obeattie(dot)com>
> wrote:
> > Hi all,
> >
> > I'm trying to debug an issue I'm seeing in production, whereby
> > traceback information about an exception is missing. This is
> > incredibly frustrating as it makes it extremely difficult to track
> > down errors.
>
> And what is your exception?
>
> > This has been observed before, as I found a ticket on the
> > Gunicorn GitHub site relating to this:
> >
> > https://github.com/benoitc/gunicorn/issues/214
> >
> > Specifically, what happens is when an exception is raised, the
> > traceback part of sys.exc_info() is None. To me, it seems the most
> > likely suspect is psycopg2, since this is going into C-land (though
> > obviously not the only possible explanation). I was wondering if
> > anyone on this else knows of this issue, or anything that may cause
> > it?
>
> In the last years every I've spent quite some time debugging cases of
> "there's a bug in my program, it uses psycopg, hence it's psycopg's
> fault". Luckily, always more often, this has not been the case
> anymore.
>
> If you suspect psycopg is to be blamed, run your program with psycopg
> debug enabled, capture stdout and wait for the neutrino to strike. If
> anything weird has happened into psycopg that ended up clobbering the
> exception it's likely you have a log for it, in which case we'd be
> happy to assist and debug.
>
> -- Daniele
>

You are correct, this doesn't appear to be an issue with Psycopg, instead
I've tracked it down to a piece of code in gevent:

https://bitbucket.org/denis/gevent/changeset/51f0fddafa9868841fb77d8232d14861a7e0cf92

Thanks for your help anyway

In response to

Browse psycopg by date

  From Date Subject
Next Message David Roid 2012-09-14 16:45:04 psycopg2 hang with multithread frequent queries
Previous Message Daniele Varrazzo 2012-09-06 15:37:10 Re: Tracebacks with gevent and set_wait_callback go "missing"