Commit 634f2775 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Handle import errors at lower level.

This ensure the cluster is stop and will not alter next rounds.
Use -1 to indicate a failure instead of 0.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1768 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 22310972
...@@ -30,10 +30,14 @@ def run(masters, storages, replicas, partitions, datafs, verbose): ...@@ -30,10 +30,14 @@ def run(masters, storages, replicas, partitions, datafs, verbose):
# Storage.store = store # Storage.store = store
neo.start() neo.start()
start = time() start = time()
neo_storage.copyTransactionsFrom(dfs_storage) try:
diff = time() - start try:
neo.stop() neo_storage.copyTransactionsFrom(dfs_storage)
return diff return time() - start
except:
return -1
finally:
neo.stop()
def runMatrix(datafs, storages, replicas, verbose): def runMatrix(datafs, storages, replicas, verbose):
stats = {} stats = {}
...@@ -41,12 +45,8 @@ def runMatrix(datafs, storages, replicas, verbose): ...@@ -41,12 +45,8 @@ def runMatrix(datafs, storages, replicas, verbose):
for s in storages: for s in storages:
for r in [r for r in replicas if r < s]: for r in [r for r in replicas if r < s]:
stats.setdefault(s, {}) stats.setdefault(s, {})
try: speed = size / run(1, s, r, 100, datafs, verbose)
speed = size / run(1, s, r, 100, datafs, verbose) stats[s][r] = speed / 1024
stats[s][r] = speed / 1024
except:
raise
stats[s][r] = 0
return stats return stats
def buildArray(storages, replicas, results): def buildArray(storages, replicas, results):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment