nameko / nameko-sentry

Apache License 2.0
28 stars 9 forks source link

Raven 6.3.0 "'Queue' object has no attribute 'all_tasks_done'" #14

Closed geoffjukes closed 6 years ago

geoffjukes commented 6 years ago

I'm seeing these errors/warnings in the logs using Raven 6.3.0

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/opt/io/storage/.env/lib/python3.5/site-packages/raven/transport/threaded.py", line 65, in main_thread_terminated
if not self._timed_queue_join(initial_timeout):
File "/opt/io/storage/.env/lib/python3.5/site-packages/raven/transport/threaded.py", line 96, in _timed_queue_join
queue.all_tasks_done.acquire()
AttributeError: 'Queue' object has no attribute 'all_tasks_done'

Is this a bug in the current release of Raven?

mattbennett commented 6 years ago

This error the result of using the threaded Raven transport in an Eventlet environment. It is mostly harmless because it only occurs at teardown. Raven includes an Eventlet transport though, which avoids the error and has the side-effect of not blocking the Nameko worker thread.

You used to be able to select the transport using the DSN (e.g. eventlet+http://...) although this has been deprecated.

I used to think it was somewhat useful to be able to opt-in to using the eventlet transport, but now I think nameko-sentry should just hardcode the transport when it creates the client. In the mean time prepending your DSN with eventlet+ will still work until transport selection via DSN is actually removed.

geoffjukes commented 6 years ago

Thanks @mattbennett, I'll update my DSN's. I agree regarding hard-coding the tra nsport - it's not as if Eventlet is optional ;)

geoffjukes commented 6 years ago

Now I get a warning:

UserWarning: Transport selection via DSN is deprecated. You should explicitly pass the transport class to Client() instead.

So I'm going to revert my change to the DSN, and just live with the warning. I do only get it when an exception is thrown (the above, I get on every start)

mattbennett commented 6 years ago

The warning here is just telling you that transport selection via DSN is deprecated and will be removed in the future. It still works, for now.

The other message is an exception, albeit one that happens inside an eventlet thread and doesn't bubble out.

So pick your poison 😉 They're both benign but I'll cut a release soon that hardcodes the transport and does away with both of them.

geoffjukes commented 6 years ago

@mattbennett "I'll cut a release soon that hardcodes the transport and does away with both of them" :)

mattbennett commented 6 years ago

Sorry for the delay @geoffjukes. This is fixed in #15 and released in version 1.0.0 🎉