diff --git a/ceilometer/middleware.py b/ceilometer/middleware.py index b208a48967..0cf6ca76c0 100644 --- a/ceilometer/middleware.py +++ b/ceilometer/middleware.py @@ -19,12 +19,16 @@ import oslo_messaging from ceilometer.agent import plugin_base from ceilometer import sample + +# NOTE(sileht): reading config values at loadtime won't works +# we should use set_defaults at runtime to set http_control_exchanges to +# [cfg.CONF.nova_control_exchange, +# cfg.CONF.glance_control_exchange, +# cfg.CONF.neutron_control_exchange, +# cfg.CONF.cinder_control_exchange], OPTS = [ cfg.MultiStrOpt('http_control_exchanges', - default=[cfg.CONF.nova_control_exchange, - cfg.CONF.glance_control_exchange, - cfg.CONF.neutron_control_exchange, - cfg.CONF.cinder_control_exchange], + default=['nova', 'glance', 'neutron', 'cinder'], help="Exchanges name to listen for notifications."), ] diff --git a/ceilometer/storage/impl_sqlalchemy.py b/ceilometer/storage/impl_sqlalchemy.py index e44f368c70..1de134d7c5 100644 --- a/ceilometer/storage/impl_sqlalchemy.py +++ b/ceilometer/storage/impl_sqlalchemy.py @@ -338,8 +338,11 @@ class Connection(base.Connection): return internal_id - @api.wrap_db_retry(retry_interval=cfg.CONF.database.retry_interval, - max_retries=cfg.CONF.database.max_retries, + # FIXME(sileht): use set_defaults to pass cfg.CONF.database.retry_interval + # and cfg.CONF.database.max_retries to this method when global config + # have been removed (puting directly cfg.CONF don't work because and copy + # the default instead of the configured value) + @api.wrap_db_retry(retry_interval=10, max_retries=10, retry_on_deadlock=True) def record_metering_data(self, data): """Write the data to the backend storage system.