root of exception not visible

19 views
Skip to first unread message

Thomas Güttler

unread,
Nov 29, 2013, 8:32:55 AM11/29/13
to python...@googlegroups.com
Hi,

I like python since more then ten years. Up to now I did non-async programming and it was always quite easy to find
the root (bug) of an exception.

Current problem:

2013-11-29 14:18:51 pulsar: ERROR    [14026] Unhandled exception in event loop callback.
Traceback (most recent call last):
  File "/home/foo_eins_dmes/src/pulsar/pulsar/async/eventloop.py", line 680, in _run_once
    value = callback()
  File "/home/foo_eins_dmes/src/pulsar/pulsar/async/pollers.py", line 168, in handle_events
    error()
  File "/home/foo_eins_dmes/src/pulsar/pulsar/async/eventloop.py", line 142, in __call__
    return self._callback(*args, **kwargs)
  File "/home/foo_eins_dmes/src/pulsar/pulsar/async/stream.py", line 501, in sock_connect
    return future.callback(exc)
  File "/home/foo_eins_dmes/src/pulsar/pulsar/async/defer.py", line 670, in callback
    raise InvalidStateError
InvalidStateError

How can I find the root of the problem here?

The only part which is from me, is "callback" in the upper most traceback line.

If I modify eventloop in line 680 and add a "print callback" I get this:

<functools.partial object at 0x1876d08>

... OK, now I write to this list and ask the experts.

How do you debug exceptions like this?

Background:

I tried different async frameworks during the last days (tornado, Autobahn(twisted) and pulsar).

And for me, error handling and logging is quite difficult in all of them.

Pulsar looks clean, up to date and well documented (thumbs up)

  Thomas




lsbardel

unread,
Nov 29, 2013, 3:26:14 PM11/29/13
to python...@googlegroups.com
This is a pulsar bug

Current problem:

2013-11-29 14:18:51 pulsar: ERROR    [14026] Unhandled exception in event loop callback.
Traceback (most recent call last):
  File "/home/foo_eins_dmes/src/pulsar/pulsar/async/eventloop.py", line 680, in _run_once
    value = callback()
  File "/home/foo_eins_dmes/src/pulsar/pulsar/async/pollers.py", line 168, in handle_events
    error()
  File "/home/foo_eins_dmes/src/pulsar/pulsar/async/eventloop.py", line 142, in __call__
    return self._callback(*args, **kwargs)
  File "/home/foo_eins_dmes/src/pulsar/pulsar/async/stream.py", line 501, in sock_connect
    return future.callback(exc)
  File "/home/foo_eins_dmes/src/pulsar/pulsar/async/defer.py", line 670, in callback
    raise InvalidStateError
InvalidStateError

How can I find the root of the problem here?

The only part which is from me, is "callback" in the upper most traceback line.

 
Unfortunately pulsar 0.7 series have a bug in synchronous clients (I think you get this traceback while using a force_sync=True), therefore this is not an issue with your code but with pulsar internals. The bug is resolved in the 0.8 version which is currently under development.

Having said that, exceptions and tracebacks in asynchronous code are somehow more difficult to figure out than standard synchronous code, and the one above is probably the worse traceback one can get (as you said it doesn't say anything useful).


How do you debug exceptions like this?
 
it is a non trivial one, and requires knowledge of pulsar internals.
  
Background:

I tried different async frameworks during the last days (tornado, Autobahn(twisted) and pulsar).

And for me, error handling and logging is quite difficult in all of them.

agree
 
Pulsar looks clean, up to date and well documented (thumbs up)
 
thanks

Reply all
Reply to author
Forward
0 new messages