Merge "Fixed collector unhandled exception management"

This commit is contained in:
Jenkins 2015-05-12 16:04:35 +00:00 committed by Gerrit Code Review
commit dd3cc99123

View File

@ -177,18 +177,22 @@ class Worker(BaseWorker):
break
for service in CONF.collect.services:
try:
try:
data = self._collect(service, timestamp)
except collector.NoDataCollected:
raise
except Exception as e:
LOG.warn('Error while collecting service {service}:'
' {error}'.format(service=service,
error=str(e)))
raise collector.NoDataCollected('', service)
except collector.NoDataCollected:
begin = timestamp
end = begin + self._period
for processor in self._processors:
processor.obj.nodata(begin, end)
self._storage.nodata(begin, end, self._tenant_id)
except Exception as e:
LOG.warn('Error while collecting service {service}:'
' {error}'.format(service=service,
error=str(e)))
else:
# Rating
for processor in self._processors: