kazoo
kazoo copied to clipboard
gevent is only usable from a single thread exception while get zk node data
File "/usr/local/lib/python2.7/dist-packages/kazoo/client.py", line 978, in get return self.get_async(path, watch).get() File "/usr/local/lib/python2.7/dist-packages/gevent/event.py", line 214, in get result = get_hub().switch() File "/usr/local/lib/python2.7/dist-packages/gevent/hub.py", line 135, in get_hub raise NotImplementedError('gevent is only usable from a single thread') NotImplementedError: gevent is only usable from a single thread
kazoo==2.0 Python 2.7.6
Have u monkey patched the rest of your application, mixing threads and coroutines never seems to end well (the same can be said about eventlet too, see https://review.openstack.org/#/c/154642/2/specs/eventlet-best-practices.rst for some interesting other details)....
- http://gevent.org/intro.html#monkey-patching
No. I am simply using Python multi-threading.
Ya, I think that's probably why, gevent (and eventlet to) both act like this when used in mixed-mode. So I'd personally not recommend mixing.