[ARVADOS] updated: a239e2db534cc36aa8c3e08077383d84bf6ba8e8

git at public.curoverse.com git at public.curoverse.com
Wed Mar 18 13:44:31 EDT 2015


Summary of changes:
 sdk/cli/bin/crunch-job | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

       via  a239e2db534cc36aa8c3e08077383d84bf6ba8e8 (commit)
      from  3365d47ab4f504a1e849852691313cddd89d0f15 (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 a239e2db534cc36aa8c3e08077383d84bf6ba8e8
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Mar 18 13:48:11 2015 -0400

    5500: Add TASK_TEMPFAIL constant.  shell_or_die always exits non-zero on error.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index d40df90..b74d7af 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -96,6 +96,7 @@ use File::Temp;
 use Fcntl ':flock';
 use File::Path qw( make_path remove_tree );
 
+use constant TASK_TEMPFAIL => 111;
 use constant EX_TEMPFAIL => 75;
 
 $ENV{"TMPDIR"} ||= "/tmp";
@@ -1011,7 +1012,7 @@ sub reapchildren
   {
     my $temporary_fail;
     $temporary_fail ||= $Jobstep->{node_fail};
-    $temporary_fail ||= ($exitvalue == 111);
+    $temporary_fail ||= ($exitvalue == TASK_TEMPFAIL);
 
     ++$thisround_failed;
     ++$thisround_failed_multiple if $Jobstep->{'failures'} >= 1;
@@ -1831,6 +1832,8 @@ use Fcntl ':flock';
 use File::Path qw( make_path remove_tree );
 use POSIX qw(getcwd);
 
+use constant TASK_TEMPFAIL => 111;
+
 # Map SDK subdirectories to the path environments they belong to.
 my %SDK_ENVVARS = ("perl/lib" => "PERLLIB", "ruby/lib" => "RUBYLIB");
 
@@ -1878,7 +1881,7 @@ if (@ARGV) {
   if ((!$venv_built) and (-d $python_src) and can_run("virtualenv")) {
     shell_or_die(undef, "virtualenv", "--quiet", "--system-site-packages",
                  "--python=python2.7", $venv_dir);
-    shell_or_die(111, "$venv_dir/bin/pip", "--quiet", "install", "-I", $python_src);
+    shell_or_die(TASK_TEMPFAIL, "$venv_dir/bin/pip", "--quiet", "install", "-I", $python_src);
     $venv_built = 1;
     $Log->("Built Python SDK virtualenv");
   }
@@ -2000,7 +2003,7 @@ sub can_run {
 
 sub shell_or_die
 {
-  my $tempfail = shift;
+  my $exitcode = shift;
 
   if ($ENV{"DEBUG"}) {
     print STDERR "@_\n";
@@ -2011,12 +2014,12 @@ sub shell_or_die
     my $exitstatus = sprintf("exit %d signal %d", $code >> 8, $code & 0x7f);
     open STDERR, ">&STDERR_ORIG";
     system ("cat $destdir.log >&2");
-    print STDERR "@_ failed ($err): $exitstatus";
-    if ($tempfail) {
-      exit $tempfail;
+    warn "@_ failed ($err): $exitstatus";
+    if (defined($exitcode)) {
+      exit $exitcode;
     }
     else {
-      exit ($code >> 8);
+      exit (($code >> 8) || 1);
     }
   }
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list