[openstack-dev] [ceilometer] Error "No handler could be found for logger "stevedore.extension""

Jiang, Yunhong yunhong.jiang at intel.com
Wed Nov 14 00:57:03 UTC 2012


Doug, thanks for reply.

It's logging module failed to print anything other than this warning. The issue happens in followed code on _load_plugins() from stevedore/extension.py. If exception happen when loading plugin, while the code intended to log the exception stacktrace, but it printed only one warning of ""No handler could be found for logger " stevedore.extension"" printed, no stack trace at all.


   def _load_plugins(self, invoke_on_load, invoke_args, invoke_kwds):
        extensions = []
        for ep in pkg_resources.iter_entry_points(self.namespace):
            LOG.debug('found extension %r', ep)
            try:
                ext = self._load_one_plugin(ep,
                                            invoke_on_load,
                                            invoke_args,
                                            invoke_kwds,
                                            )
                if ext:
                    extensions.append(ext)
            except KeyboardInterrupt:
                raise
            except Exception as err:
                LOG.error('Could not load %r: %s', ep.name, err)   >>> not printed
                LOG.exception(err)              >>> not printed
        return extensions

IMHO, I don't think stevedore should handle the exception silently. The caller should handle that to be more flexible. Or at least it should know that some plug-in failed to load. Possibly we can return plugin iterator to caller, and caller load them one by one.

Possibly we can dsicuss on the stevedore side.

Thanks
--jyh




        IMHO the _load_plugins() in stevestore.extension should not handle the exception, instead, the caller should do that.

Is it actually an exception, or is it just the logging module reporting a warning?

In either case, I opened a bug (https://github.com/dreamhost/stevedore/issues/2) to address this in stevedore.






Thanks
--jyh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121114/95b3c9b6/attachment.html>


More information about the OpenStack-dev mailing list