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):
# Storage.store = store
neo.start()
start = time()
neo_storage.copyTransactionsFrom(dfs_storage)
diff = time() - start
neo.stop()
return diff
try:
try:
neo_storage.copyTransactionsFrom(dfs_storage)
return time() - start
except:
return -1
finally:
neo.stop()
def runMatrix(datafs, storages, replicas, verbose):
stats = {}
......@@ -41,12 +45,8 @@ def runMatrix(datafs, storages, replicas, verbose):
for s in storages:
for r in [r for r in replicas if r < s]:
stats.setdefault(s, {})
try:
speed = size / run(1, s, r, 100, datafs, verbose)
stats[s][r] = speed / 1024
except:
raise
stats[s][r] = 0
speed = size / run(1, s, r, 100, datafs, verbose)
stats[s][r] = speed / 1024
return stats
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