2013-11-04 18:24:03 |
David Peraza |
description |
Since this patch was merged https://review.openstack.org/#/c/47786/, any glance API custom log handlers that required an I/O driven event lost the ability to received such events. I have tracked it down to the monkey patch of thread module on glance/cmd/apy.py entry point. Now, the monkey-patch by it self did not cause this issue it was also the fact the in glance api we allow the eventlet_hub to be set on the glance.common.wsgi module via a call to eventlet.hubs.use_hub. The evenlet hubs documentation clearly explains the use_hopes should be done very early in the app initialization before any IO, timers and file descriptors are set: http://eventlet.net/doc/hubs.html#eventlet.hubs.use_hub.
I would argue that in glance this is done too far in the init and definitely after log handlers are initialized. The solution I propose is to move the call to use_hubs to api entry point right before log.setup('glance') call and remove from glance.common.wsgi. May keep it as a public method on glance.common.wsgi.Server class that can be called from entry point.
This is not an issue with glance registry bacause thread module is not mokey-patched
Any comments one this? Will there be any issue moving the call up? |
Since this patch was merged https://review.openstack.org/#/c/47786/, any glance API custom log handlers that required an I/O driven event lost the ability to received such events. I have tracked it down to the monkey patch of thread module on glance/cmd/apy.py entry point. Now, the monkey-patch by it self did not cause this issue it was also the fact the in glance api we allow the eventlet_hub to be set on the glance.common.wsgi module via a call to eventlet.hubs.use_hub. The evenlet hubs documentation clearly explains the use_hub should be done very early in the app initialization before any IO, timers and file descriptors are set: http://eventlet.net/doc/hubs.html#eventlet.hubs.use_hub.
I would argue that in glance this is done too far in the init and definitely after log handlers are initialized. The solution I propose is to move the call to use_hubs to api entry point right before log.setup('glance') call and remove from glance.common.wsgi. May keep it as a public method on glance.common.wsgi.Server class that can be called from entry point.
This is not an issue with glance registry bacause thread module is not mokey-patched
Any comments one this? Will there be any issue moving the call up? |
|