[openstack-dev] [nova] eventlet usage in Nova

ChangBo Guo glongwave at gmail.com
Thu Jul 9 03:06:50 UTC 2015


In addition to the monkey_patch questions,  we use eventlet's same function
with different ways, there is some example:

greenthread.sleep(0)  vs time.sleep(0)
-----------------------------------------------------
greenthread.spawn   vs eventlet.spawn

I'm updating doc [1] to show different ways ,  shall  we need unify the way,
if yes, which way is better

[1]  https://review.openstack.org/#/c/199013


2015-07-08 16:51 GMT+08:00 ChangBo Guo <glongwave at gmail.com>:

> we use eventlet in nova code base , at the beginning of  each nova service
> we monkey_patched standard libraries like:
>
> import eventlet
>
> from nova import debugger
>
> if debugger.enabled():
>     # turn off thread patching to enable the remote debugger
>     eventlet.monkey_patch(os=False, thread=False)
> else:
>     eventlet.monkey_patch(os=False)
>
> I find an related comments about monkey_patch(os=False) from Cinder code:
> if os.name == 'nt':
>     # eventlet monkey patching the os module causes subprocess.Popen to
> fail
>     # on Windows when using pipes due to missing non-blocking IO support.
>     eventlet.monkey_patch(os=False)
> else:
>     eventlet.monkey_patch()
>
>
> My question is : Is there any other reason we didn't monkey_patch os in
> Nova
>
> --
> ChangBo Guo(gcb)
>



-- 
ChangBo Guo(gcb)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150709/b5d961da/attachment.html>


More information about the OpenStack-dev mailing list