drop non-I/O threading in upgrade

threading does nothing in python unless the task is heavily
I/O-dependent. we already use threads to retrieve data so we
really shouldn't wrap entire upgrade step in threading as it doesn't
offer any benefits.

Partial-Bug: #1600796
Change-Id: Ia4e834e6566cf053b9f26b2bee9142dff0c72444
This commit is contained in:
gord chung 2016-08-19 14:17:57 +00:00 committed by gordon chung
parent 21e57add2e
commit 84443ca4d4
1 changed files with 5 additions and 5 deletions

View File

@ -312,13 +312,13 @@ class CarbonaraBasedStorage(storage.StorageDriver):
def upgrade(self, index):
marker = None
while True:
metrics = [(metric,) for metric in
index.list_metrics(limit=self.UPGRADE_BATCH_SIZE,
marker=marker)]
self._map_in_thread(self._check_for_metric_upgrade, metrics)
metrics = index.list_metrics(limit=self.UPGRADE_BATCH_SIZE,
marker=marker)
for m in metrics:
self._check_for_metric_upgrade(m)
if len(metrics) == 0:
break
marker = metrics[-1][0].id
marker = metrics[-1].id
def process_new_measures(self, indexer, metrics_to_process, sync=False):
metrics = indexer.list_metrics(ids=metrics_to_process)