I have been encountering these quite a bit myself recently in another project.  <div><br></div><div>For me the errors were a result of tpool.execute() in a non-cooperative thread context.  My guess as to the root cause is that some of eventlet's cooperative waiting code is not safe to use when not running in an eventlet coroutine context.  My solution (which may not work for you) involved switching based on whether I'm in a greenthread or not, and either call tpool.execute() or the underlying function directly.  Fortunately for me I can know at compile time what context I will be in. I think there is a way to query eventlet to see if you are currently in a greenthread or not, but I haven't finished diving into that documentation yet.</div>
<div><br></div><div>Good luck,</div><div><div>Mark</div><div><br><div class="gmail_quote">On Wed, Feb 29, 2012 at 1:02 PM, Yun Mao <span dir="ltr"><<a href="mailto:yunmao@gmail.com">yunmao@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
we sometimes notice this error message which prevent us from starting<br>
nova services occasionally. We are using a somewhat modified diablo<br>
stable release on Ubuntu 11.10. It may very well be the problem from<br>
our patches but I'm wondering if you guys have any insight. In what<br>
condition does this error occur? There is a similar bug in here:<br>
<a href="https://bugs.launchpad.net/nova/+bug/831599" target="_blank">https://bugs.launchpad.net/nova/+bug/831599</a><br>
<br>
but that doesn't offer much insight to me. Helps are very appreciated. Thanks,<br>
<br>
Yun<br>
<br>
2012-02-23 16:54:52,788 DEBUG nova.utils<br>
[43f98259-6ba8-4e5d-bc0e-9eab978194e5 None None] backend <module<br>
'nova.db.sqlalchemy.api' from<br>
'/opt/stack/nova/nova/db/sqlalchemy/api.pyc'> from (pid=6385)<br>
__get_backend /opt/stack/nova/nova/utils.py:449<br>
Traceback (most recent call last):<br>
  File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line<br>
336, in fire_timers<br>
    timer()<br>
  File "/usr/lib/python2.7/dist-packages/eventlet/hubs/timer.py", line<br>
56, in __call__<br>
    cb(*args, **kw)<br>
  File "/usr/lib/python2.7/dist-packages/eventlet/semaphore.py", line<br>
95, in _do_acquire<br>
    waiter.switch()<br>
error: cannot switch to a different thread<br>
<br>
_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
</blockquote></div><br></div></div>