[openstack-dev] [Oslo.db] Eventlet in db (was, Replacing Glance DB code to Oslo DB code.)

Mark Washenberger mark.washenberger at markwash.net
Tue Aug 20 18:24:25 UTC 2013


We do something similar that works in python-glanceclient.

https://github.com/openstack/python-glanceclient/blob/master/glanceclient/common/http.py#L43


On Tue, Aug 20, 2013 at 10:09 AM, Joshua Harlow <harlowja at yahoo-inc.com>wrote:

>  Ok, that’s good.
>
>  I don't think the following though would work. Maybe something else is
> needed?
>
>  try:
>     import eventlet
>     eventlet_on = True
> except ImportError:
>     eventlet_on = False
>
>  Due to how oslo.db could be used the environment may actually have
> eventlet installed (say a server running keystone and nova-api at the same
> time). The first project (keystone) might not want to use eventlet (but it
> might be in the python module path, while nova-api on the same box would
> want to use it). So we might need a more advanced configuration setting to
> make this tunable (and not depend on the python import statement to be that
> tunable setting).
>
>   From: Ben Nemec <openstack at nemebean.com>
> Reply-To: "openstack at nemebean.com" <openstack at nemebean.com>, OpenStack
> Development Mailing List <openstack-dev at lists.openstack.org>
> Date: Monday, August 19, 2013 9:41 PM
> To: "openstack-dev at lists.openstack.org" <openstack-dev at lists.openstack.org
> >
> Subject: Re: [openstack-dev] [Glance] Replacing Glance DB code to Oslo DB
> code.
>
>   On 08/19/13 20:34, Joshua Harlow wrote:
>
> Just a related question,
>
> Oslo 'incubator' db code I think depends on eventlet. This means any code
> that uses the oslo.db code could/would(?) be dependent on eventlet.
>
> Will there be some refactoring there to not require it (useful for
> projects that are trying to move away from eventlet).
>
>
> https://github.com/openstack/oslo-incubator/blob/master/openstack/common/db/sqlalchemy/session.py#L248
>
>
> Glancing through that file, it looks like the greenthread import is only
> used for playing nice with other greenthreads.  It should be pretty easy to
> make it conditional so we don't require it, but will use it if it's
> available.
>
> -Ben
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130820/d26034a4/attachment.html>


More information about the OpenStack-dev mailing list