Don't update the state of a scope when no data was collected
This makes the worker return instead of raising NoDataCollected when an exception occurs during collection. Before this patch, a NoDataCollected exception was raised when a collect exception occured. This caused the worker to update the collect state and to process the next period, leading to missing data in the storage backend. With this patch, the collect state is not updated anymore. Change-Id: I0f7c6d6e4cdc28ad6245b863d396c4f9403de380 Story: 2003828 Task: 26761 Task: 26763
This commit is contained in:
parent
7778986c3a
commit
7881c15093
|
@ -202,14 +202,19 @@ class Worker(BaseWorker):
|
|||
except Exception as e:
|
||||
LOG.warning(
|
||||
'[%(scope_id)s] Error while collecting metric '
|
||||
'%(metric)s: %(error)s',
|
||||
'%(metric)s: %(error)s. Retrying on next '
|
||||
'collection cycle.',
|
||||
{
|
||||
'scope_id': self._tenant_id,
|
||||
'metric': metric,
|
||||
'error': e,
|
||||
},
|
||||
)
|
||||
raise collector.NoDataCollected('', metric)
|
||||
# FIXME(peschk_l): here we just exit, and the
|
||||
# collection will be retried during the next collect
|
||||
# cycle. In the future, we should implement a retrying
|
||||
# system in workers
|
||||
return
|
||||
except collector.NoDataCollected:
|
||||
LOG.info(
|
||||
'[{}] No data collected for metric {} '
|
||||
|
|
Loading…
Reference in New Issue