← Back to team overview

openstack team mailing list archive

Re: eventlet weirdness


Thanks for the explanation. Let me see if I understand this.

1. Eventlet will never have this problem if there is only 1 OS thread
-- let's call it main thread.
2. In Nova, there is only 1 OS thread unless you use xenapi and/or the
virt/firewall driver.
3. The python logging module uses locks. Because of the monkey patch,
those locks are actually eventlet or "green" locks and may trigger a
green thread context switch.

Based on 1-3, does it make sense to say that in the other OS threads
(i.e. not main thread), if logging (plus other pure python library
code involving locking) is never used, and we do not run a eventlet
hub at all, we should never see this problem?



On Wed, Feb 29, 2012 at 5:24 PM, Johannes Erdfelt <johannes@xxxxxxxxxxx> wrote:
> On Wed, Feb 29, 2012, Yun Mao <yunmao@xxxxxxxxx> wrote:
>> we sometimes notice this error message which prevent us from starting
>> nova services occasionally. We are using a somewhat modified diablo
>> stable release on Ubuntu 11.10. It may very well be the problem from
>> our patches but I'm wondering if you guys have any insight. In what
>> condition does this error occur? There is a similar bug in here:
>> https://bugs.launchpad.net/nova/+bug/831599
>> but that doesn't offer much insight to me. Helps are very appreciated. Thanks,
> greenlet threads (used by eventlet) can't be scheduled across real
> threads. This usually isn't done explicitly, but can happen as a side
> effect if code uses locks. logging is one instance that I've run into.
> This generally hasn't been a problem with nova since it uses the
> eventlet monkey patching that makes it hard to generate real threads.
> There are two places (at least in trunk) where you need to be careful,
> both nova/virt/xenapi_conn.py and libvirt/firewall.py use tpool which
> does create a real thread in the background.
> If you use logging (and it's not the only source of this problem) then
> you can run into this eventlet message.
> JE
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp

Follow ups