[ARVADOS] updated: e9c0ab574e6bae899556e82d4ba0da439a976093
git at public.curoverse.com
git at public.curoverse.com
Mon Jul 7 09:11:33 EDT 2014
Summary of changes:
crunch_scripts/run-command | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
via e9c0ab574e6bae899556e82d4ba0da439a976093 (commit)
from 280e17d8c95b5488e6cfabb7304c8b95e1102dfb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit e9c0ab574e6bae899556e82d4ba0da439a976093
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Mon Jul 7 08:59:24 2014 -0400
run-command retry after exception when writing output to keep. no issue #
diff --git a/crunch_scripts/run-command b/crunch_scripts/run-command
index 6335523..a8aae24 100755
--- a/crunch_scripts/run-command
+++ b/crunch_scripts/run-command
@@ -7,11 +7,14 @@ import subprocess
import sys
import shutil
import subst
+import time
os.umask(0077)
t = arvados.current_task().tmpdir
+api = arvados.api('v1')
+
os.chdir(arvados.current_task().tmpdir)
os.mkdir("tmpdir")
os.mkdir("output")
@@ -71,13 +74,20 @@ finally:
out = arvados.CollectionWriter()
out.write_directory_tree(".", max_manifest_depth=0)
- outuuid = out.finish()
- arvados.api('v1').job_tasks().update(uuid=arvados.current_task()['uuid'],
- body={
- 'output':outuuid,
- 'success': (rcode == 0),
- 'progress':1.0
- }).execute()
+ done = False
+ while not done:
+ try:
+ outuuid = out.finish()
+ api.job_tasks().update(uuid=arvados.current_task()['uuid'],
+ body={
+ 'output':outuuid,
+ 'success': (rcode == 0),
+ 'progress':1.0
+ }).execute()
+ done = True
+ except Exception as e:
+ print("run-command: caught exception: {}".format(e))
+ time.sleep(5)
if rcode == 0:
os.chdir("..")
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list