← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1247889] Re: Custom log handlers lost ability to register event listeners

 

** Changed in: glance
       Status: Fix Committed => Fix Released

** Changed in: glance
    Milestone: None => juno-3

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1247889

Title:
  Custom log handlers lost ability to register event listeners

Status in OpenStack Image Registry and Delivery Service (Glance):
  Fix Released

Bug 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_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?

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1247889/+subscriptions