Обсуждение: Tracebacks with gevent and set_wait_callback go "missing"

Поиск
Список
Период
Сортировка

Tracebacks with gevent and set_wait_callback go "missing"

От
Oliver Beattie
Дата:
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. 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?

Many thanks!

– Oliver


Re: Tracebacks with gevent and set_wait_callback go "missing"

От
Daniele Varrazzo
Дата:
On Thu, Sep 6, 2012 at 4:09 PM, Oliver Beattie <oliver@obeattie.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


Re: Tracebacks with gevent and set_wait_callback go "missing"

От
Oliver Beattie
Дата:
On 6 September 2012 16:37, Daniele Varrazzo <daniele.varrazzo@gmail.com> wrote:
On Thu, Sep 6, 2012 at 4:09 PM, Oliver Beattie <oliver@obeattie.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:


Thanks for your help anyway